Skip to content

Commit b43bd2d

Browse files
committed
Oh my
1 parent f51fd50 commit b43bd2d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

maven-wrapper-plugin/src/test/java/org/apache/maven/plugins/wrapper/WrapperMojoTest.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,33 @@
2020

2121
import org.eclipse.aether.RepositorySystem;
2222
import org.eclipse.aether.RepositorySystemSession;
23+
import org.junit.jupiter.api.BeforeEach;
2324
import org.junit.jupiter.api.Test;
2425
import org.junit.jupiter.api.extension.ExtendWith;
2526
import org.mockito.InjectMocks;
27+
import org.mockito.Mock;
2628
import org.mockito.junit.jupiter.MockitoExtension;
2729

2830
import static org.junit.jupiter.api.Assertions.assertEquals;
2931
import static org.mockito.ArgumentMatchers.any;
3032
import static org.mockito.ArgumentMatchers.anyList;
31-
import static org.mockito.Mockito.mock;
3233
import static org.mockito.Mockito.when;
3334

3435
@ExtendWith(MockitoExtension.class)
3536
class WrapperMojoTest {
36-
private final RepositorySystem repositorySystem;
37+
@Mock(strictness = Mock.Strictness.LENIENT)
38+
private RepositorySystem repositorySystem;
3739

38-
private final RepositorySystemSession repositorySystemSession;
40+
@Mock
41+
private RepositorySystemSession repositorySystemSession;
3942

4043
@InjectMocks
41-
private WrapperMojo wrapperMojo = new WrapperMojo();
44+
private WrapperMojo wrapperMojo;
4245

43-
WrapperMojoTest() {
44-
this.repositorySystem = mock(RepositorySystem.class);
46+
@BeforeEach
47+
void setupMocks() {
4548
when(repositorySystem.newResolutionRepositories(any(RepositorySystemSession.class), anyList()))
4649
.then(i -> i.getArguments()[1]);
47-
this.repositorySystemSession = mock(RepositorySystemSession.class);
4850
}
4951

5052
@Test

0 commit comments

Comments
 (0)