Open ShivangMishra opened 1 year ago
@rohanKanojia does this issue look okay? I'll create a PR for this one after GSoC.
Looks okay to me. Could you also list the test classes that would require changes in order to fix this issue?
I'll create a PR for this one after GSoC.
I think someone else can also pick it up if we explain the issue clearly.
@rohanKanojia lots of test classes use mock. I'll make a google sheet and will add it in the description. Would that be okay?
@ShantKhatri if you're interested, please go through this issue and make a list... You can start by making similar changes in the generators. Make a draft PR once this much is done.
@ShivangMishra : Yeah, sounds good. Just make sure permissions are open for anyone.
I am not sure to understand the value, it makes the test "bigger" from what I see
I am not sure to understand the value, it makes the test "bigger" from what I see
Instead of using mocks, we should test on real objects. As far as I understand, we should use mocks only when we cannot directly test on real objects(maybe because the implementation is not complete). This will prevent complications like we got that Null Pointer Exception earlier.
Also, it won't make the tests bigger. In this example, setup() in the screenshot at the bottom is bigger because I have used some extra properties. I'll update it with a better example.
@rohanKanojia @ShivangMishra I have created list of files which includes mock testing. Here is the google sheet: https://docs.google.com/spreadsheets/d/14bcELvvAVEx5bI30GNgktjqVe6zrx562pRNjjVeI7aA/edit?usp=sharing Could you please guide me more on this? so I can start work on it.
Hi @ShantKhatri, Are you working on this?
Hi @ShantKhatri, Are you working on this?
I was waiting for reply from @rohanKanojia and @ShivangMishra that from above sheet in which files mocking should we have to replace with generator tests?
@rohanKanojia @manusa Do I need to create a separate issue for each file on which I'm working, or can I create a PR for this (https://github.com/eclipse/jkube/issues/2316) issue only? In that case, there would be multiple PRs linked with a single issue.
I'd start just with one of the files so that you get feedback on your approach.
I'd start just with one of the files so that you get feedback on your approach.
@manusa Could you please guide me with approach?
Component
None
Task description
Description
Currently, in BaseGeneratorTest, JavaExecGeneratorTest, WebAppGeneratorTest, etc. we use mockito to mock the generator which we want to test. We can replace the mocks by building the generator and the java project using the corresponding JavaProject and GeneratorContext builders.
Expected Behavior
This is an example of how the tests should be written -
Here's an example with the same properties
Acceptance Criteria