Gatling with Spring

Hi
We want to use spring framework in our gatling java project, is there any example we can follow?

Hi,

What are you trying to achieve exactly? What kind of components can’t you instantiate directly? It’s not like you’ll need AOP for your Gatling tests.

the model class are defined as spring prototype bean in other test project, we want to reuse them in gatling without rewrite all of them again.

Then you have to create the ApplicationContext and pull the desired beans programmatically.

Is there any examples to load spring context with Gatling Java?

Nothing to do with Gatling here. You have to retrieve your beans from you ApplicationContext in Java code that is not aware of spring at instanciation time.

See an article of Baeldung

Cheers!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.