Skip to content

Commit

Permalink
test: replace mock with builder (3414)
Browse files Browse the repository at this point in the history
Replaced Mockito.mock by creating actual object
---
 remove redundant initialization of javaProject in setup method
---
Removed Unused Imports
  • Loading branch information
ShivamChavan01 authored Oct 2, 2024
1 parent bfd3ef9 commit eb29732
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
import java.nio.file.Files;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.mockito.Answers.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;


class OpenLibertyUtilsTest {

Expand All @@ -36,8 +34,9 @@ class OpenLibertyUtilsTest {

@BeforeEach
void setup() {
javaProject = mock(JavaProject.class, RETURNS_DEEP_STUBS);
when(javaProject.getBaseDirectory()).thenReturn(temporaryFolder);
javaProject = JavaProject.builder()
.baseDirectory(temporaryFolder)
.build();
}

@Test
Expand Down

0 comments on commit eb29732

Please sign in to comment.