-
Notifications
You must be signed in to change notification settings - Fork 18
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
Option to generate getters #31
Comments
Could you elaborate a bit? I'm not referring to the Mockito part per se, but the need for mocking the configuration in the first place. Is it perhaps that there's not direct way to instantiate the config classes (other than via a Typesafe Config object)? |
Sorry for the late reply.
I am not exactly sure what you mean. The problem is that the class under test is tightly coupled with the Conf object, but requires only single configuration parameter (bad desgin). So the simple thing required for testing is Mockito.when(conf.getA()).thenReturn(x), which is not possible. Thank you for bringing type safety and auto completion to configuration. |
@bhchandra I've just implemented your suggestion. New release 0.9.3. The new option is |
I am unable to mock generated Conf class for testing with Mockito even after enabling mocking final classes/methods in Mockito.
This is failing with Mockito.when(...).thenReturn(...);
I am guessing this is because Mockito can mock only method calls.
The text was updated successfully, but these errors were encountered: