Am having issues when using @MockBean in conjunction with Camunda.
Getting Error:
Cannot stop service org.camunda.bpm.platform.process-engine:type=default: no such service registered: service is null.
Single Tests work OK but will get this Error when running full Test Suite.
Using “@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)” in Tests.
This is demonstrated in the following Repository link:
Within your tests you are trying to register multiple beans within the same application context. This is wrong usage of spring (testing). This is not related to the extension.
Hints:
use different contexts/configurations (one to use @Autowired private IntService intService; and one to use
@MockBean private IntService intService;).
or
dirty the context, for example:
@RunWith(SpringRunner.class)
@SpringBootTest
@DirtiesContext
public class IntServiceMockTest {
@MockBean
private IntService intService;
...
hmm not sure if this is a similar problem.
I dont understand what you mean by the first hint, we’ve tried the second hint but this doesnt seem to work either.
Are you able to run the test suite on the attached respitory to help understand and possible resolve the issue?