You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate code that mocks using some lib instead of the aspectj playback code and verifies the return values/parameter values (most mocking libs supports both sequential return values from mocks (like the lib works now) and based on parameters (see other task).
I think of starting on this task by making a test that checks if a mocking lib is usable (i.e. it can mock invocations without making interfaces/changing existing code).
The text was updated successfully, but these errors were encountered:
Actually according to my tests (see my branch, they run in eclipse) it seems like Powermock has the required properties to be able to mock the method invocations without any change of the legacy code. Combining object creating interception and partial mocks seems to do the job.
It even does not require any special command line to the java command, as the aspectj. Maybe that one or technology it uses can replace the aspects too?
I guess it also would be possible to generate and the mock test dynamically using the JMock API (and include annotation @PrepareEverythingForTest somewhere) from the recorded data in e.g. json-format, instead of generating any java code.
If somebody know a better lib to generate java code and how to compile the generated code to test it, please let me know. Velocity could be an option I know.
Generate code that mocks using some lib instead of the aspectj playback code and verifies the return values/parameter values (most mocking libs supports both sequential return values from mocks (like the lib works now) and based on parameters (see other task).
I think of starting on this task by making a test that checks if a mocking lib is usable (i.e. it can mock invocations without making interfaces/changing existing code).
The text was updated successfully, but these errors were encountered: