New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update unit testing environment to use mocks #120
Conversation
integration test - TRUNK-3586
integration test classes when checking for Test classes that don't end with Test or IT - TRUNK-3586
ConceptMapTypeValidatorIT - TRUNK-3586
@@ -285,7 +314,11 @@ public void shouldNotAllowTaskExecuteToRunBeforeInitializationIsComplete() throw | |||
} | |||
} | |||
|
|||
/** | |||
* TODO This should be an integration test, get rid of it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so do get rid of it instead of putting @ignore. :-)
@Before | ||
public void before() { | ||
MessageSourceService as = mock(MessageSourceService.class); | ||
PowerMockito.stub(PowerMockito.method(Context.class, "getMessageSourceService")).toReturn(as); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to use plain Mockito here: Mockito.when(Context.getMessageSourceService()).thenReturn(as);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is that i need to mock some methods at the sametime invoke the actual code in some and at the same time i want some not to be called at all, to achieve this, i need to use stub for specific methods otherwise i will end up having the code cluttered with calls like Mockito.spy, Mockito.doCallRealMethod and Mockito.doNothing everywhere, i basically found stub much cleaner.
SonarCloud Quality Gate failed. |
…on -> frontend.json (openmrs#120) * Add support for JSON parameterization of build. And microfrontends.json -> frontend.json * Prettier * frontend.json --> spa-build-config.json
https://tickets.openmrs.org/browse/TRUNK-3586