Closed gabor7d2 closed 3 months ago
The static mock (ModelObjectFactory) has to be closed after mocking, so that it doesn't persist between tests.
One of my tests fails when your test also runs, so please urgently fix this issue, I cannot merge my tests until you fix this.
I recommend this way:
try (MockedStatic<ModelObjectFactory> mock = mockStatic(ModelObjectFactory.class)) { mock.when(ModelObjectFactory::cisternCreatePipe).thenReturn(createdPipe); cistern.spawnPipe(); }
The static mock (ModelObjectFactory) has to be closed after mocking, so that it doesn't persist between tests.
One of my tests fails when your test also runs, so please urgently fix this issue, I cannot merge my tests until you fix this.
I recommend this way: