TestController.java
@RestController
public class TestController {
@Autowired
private TestClass testClass;
@RequestMapping(value = \"/test\", method
Spring controllers are singletons by default (which is OK due to their stateless nature), as well as the other Spring beans.
That's why it is enough to instantiate only one TestClass instance for the only TestController instance.
It is easy to instantiate TestClass one more time - just inject it in another controller or get from the context programmatically