79125933

Date: 2024-10-25 13:40:33
Score: 1.5
Natty:
Report link

You can try removing the @EventListener from the initialization function and replacing it with a @PostConstruct

@PostConstruct
public void init() {
    startup();
}

This way, you can change the functioning of the initialization function without changing the functioning of the ManagementService

@BeforeEach
public void preventConnection() {
    Mockito.doNothing().when(temp).print();
}
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @EventListener
  • User mentioned (0): @PostConstructThis
  • Low reputation (1):
Posted by: Luan Nadaletti