Skip to content
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

OpenLibertyUtilsTest : Replace Mockito.mock by creating actual object #3407

Closed
1 task
rohanKanojia opened this issue Sep 25, 2024 · 1 comment · Fixed by #3414
Closed
1 task

OpenLibertyUtilsTest : Replace Mockito.mock by creating actual object #3407

rohanKanojia opened this issue Sep 25, 2024 · 1 comment · Fixed by #3414
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@rohanKanojia
Copy link
Member

Component

JKube Kit

Task description

Component

JKube Kit

Task description

Component

JKube Kit

Task description

Related to #2316

OpenLibertyUtilsTest seems to be using mock here :

This can easily be refactored to use real object using lombok builders:

      project = JavaProject.builder().build();

Similarly these when( statements can also be replaced with builder calls like this:

when(javaProject.getBaseDirectory()).thenReturn(temporaryFolder);

    javaProject = JavaProject.builder()
      .baseDirectory(temporaryFolder)
      .build();

Usage of org.mockito.Mockito.mock and org.mockito.Mockito.when is removed from OpenLibertyUtilsTest

Expected Behavior

Usages of Mockito.mock and Mockito.when are removed from OpenLibertyUtilsTest

Acceptance Criteria

  • mock statements are replaced via real variables
@rohanKanojia rohanKanojia added good first issue Good for newcomers help wanted Extra attention is needed labels Sep 25, 2024
@ShivamChavan01
Copy link
Contributor

Can i Do it @rohanKanojia

@manusa manusa added this to the 1.18.0 milestone Oct 2, 2024 — with automated-tasks
ShivamChavan01 added a commit to ShivamChavan01/jkube that referenced this issue Oct 8, 2024
…tual-object: 67d916f  remove redundant initialization of javaProject in setup method
ShivamChavan01 added a commit to ShivamChavan01/jkube that referenced this issue Oct 8, 2024
…al-object: 67d916f  remove redundant initialization of javaProject in setup method
manusa pushed a commit that referenced this issue Oct 10, 2024
…(3416)

Replaced Mockito.mock by creating actual object
---
 remove redundant initialization of javaProject in setup method
---
index on issue-#3407-replace-mockito.mock-by-creating-actual-object: 67d916f  remove redundant initialization of javaProject in setup method
---
WIP on issue-#3407-replace-mockito.mock-by-creating-actual-object: 67d916f  remove redundant initialization of javaProject in setup method
---
#3404 Replaced Mockito.mock with actual object creation in WildflyJARHealthCheckEnricherTest
---
#3404 Replaced Mockito.mock with actual object creation in WildflyJARHealthCheckEnricherTest
---
Replace Mockito mocks with actual objects in WildflyJARHealthCheckEnricherTest
---
Replace Mockito mocks with actual objects in WildflyJARHealthCheckEnricherTest
---
Reverted some lines
---
Cleaned up the code by removing extra spaces in the WildflyJARHealthCheckEnricherTest class
---
Merge branch 'eclipse-jkube:master' into issue-3404-replace-mockito-with-actual-object-in-wildflyjarhealthcheckenrichertest
---
Merge remote-tracking branch 'origin/issue-3404-replace-mockito-with-actual-object-in-wildflyjarhealthcheckenrichertest' into issue-3404-replace-mockito-with-actual-object-in-wildflyjarhealthcheckenrichertest

# Conflicts:
#	jkube-kit/jkube-kit-openliberty/src/test/java/org/eclipse/jkube/openliberty/OpenLibertyUtilsTest.java
---
Using context.getProject() for ProjectBuilder to retain updates
---
Changing the intialzation of the Context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants