File tree Expand file tree Collapse file tree 8 files changed +36
-36
lines changed
src/test/java/org/hyperledger/besu/nat Expand file tree Collapse file tree 8 files changed +36
-36
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ dependencies {
4141 testImplementation project(path : ' :ethereum:core' , configuration : ' testSupportArtifacts' )
4242 testImplementation project(' :testutil' )
4343
44- testImplementation ' junit: junit'
44+ testImplementation ' org.mockito:mockito- junit-jupiter '
4545 testImplementation ' org.assertj:assertj-core'
4646 testImplementation ' org.junit.jupiter:junit-jupiter'
4747 testImplementation ' org.mockito:mockito-core'
Original file line number Diff line number Diff line change 3333import java .util .Optional ;
3434import java .util .concurrent .CompletableFuture ;
3535
36- import org .junit .Test ;
37- import org .junit .runner . RunWith ;
38- import org .mockito .junit .MockitoJUnitRunner ;
36+ import org .junit .jupiter . api . Test ;
37+ import org .junit .jupiter . api . extension . ExtendWith ;
38+ import org .mockito .junit .jupiter . MockitoExtension ;
3939
40- @ RunWith ( MockitoJUnitRunner .class )
40+ @ ExtendWith ( MockitoExtension .class )
4141public class NatServiceTest {
4242
4343 @ Test
Original file line number Diff line number Diff line change 2929import java .util .concurrent .CompletableFuture ;
3030import java .util .concurrent .ExecutionException ;
3131
32- import org .junit .Test ;
33- import org .junit .runner . RunWith ;
32+ import org .junit .jupiter . api . Test ;
33+ import org .junit .jupiter . api . extension . ExtendWith ;
3434import org .mockito .Mockito ;
35- import org .mockito .junit .MockitoJUnitRunner ;
35+ import org .mockito .junit .jupiter . MockitoExtension ;
3636
37- @ RunWith ( MockitoJUnitRunner .class )
37+ @ ExtendWith ( MockitoExtension .class )
3838public class AbstractNatManagerTest {
3939
4040 @ Test
Original file line number Diff line number Diff line change 3030import java .util .concurrent .ExecutionException ;
3131
3232import org .assertj .core .api .Assertions ;
33- import org .junit .Before ;
34- import org .junit .Test ;
35- import org .junit .runner . RunWith ;
33+ import org .junit .jupiter . api . BeforeEach ;
34+ import org .junit .jupiter . api . Test ;
35+ import org .junit .jupiter . api . extension . ExtendWith ;
3636import org .mockito .Mock ;
37- import org .mockito .junit .MockitoJUnitRunner ;
37+ import org .mockito .junit .jupiter . MockitoExtension ;
3838
39- @ RunWith ( MockitoJUnitRunner .class )
39+ @ ExtendWith ( MockitoExtension .class )
4040public final class DockerNatManagerTest {
4141
4242 private final String advertisedHost = "99.45.69.12" ;
@@ -49,7 +49,7 @@ public final class DockerNatManagerTest {
4949
5050 private DockerNatManager natManager ;
5151
52- @ Before
52+ @ BeforeEach
5353 public void initialize () throws NatInitializationException {
5454 hostBasedIpDetector = mock (HostBasedIpDetector .class );
5555 when (hostBasedIpDetector .detectAdvertisedIp ()).thenReturn (Optional .of (detectedAdvertisedHost ));
Original file line number Diff line number Diff line change 3333import io .kubernetes .client .openapi .models .V1Service ;
3434import io .kubernetes .client .openapi .models .V1ServicePort ;
3535import io .kubernetes .client .openapi .models .V1ServiceSpec ;
36- import org .junit .Before ;
37- import org .junit .Test ;
38- import org .junit .runner . RunWith ;
36+ import org .junit .jupiter . api . BeforeEach ;
37+ import org .junit .jupiter . api . Test ;
38+ import org .junit .jupiter . api . extension . ExtendWith ;
3939import org .mockito .Mock ;
40- import org .mockito .junit .MockitoJUnitRunner ;
40+ import org .mockito .junit .jupiter . MockitoExtension ;
4141
42- @ RunWith ( MockitoJUnitRunner .class )
42+ @ ExtendWith ( MockitoExtension .class )
4343public final class KubernetesClusterIpNatManagerTest {
4444
4545 private final String detectedAdvertisedHost = "199.45.69.12" ;
@@ -51,7 +51,7 @@ public final class KubernetesClusterIpNatManagerTest {
5151
5252 private KubernetesNatManager natManager ;
5353
54- @ Before
54+ @ BeforeEach
5555 public void initialize () throws IOException {
5656
5757 when (v1Service .getSpec ())
Original file line number Diff line number Diff line change 3636import io .kubernetes .client .openapi .models .V1ServicePort ;
3737import io .kubernetes .client .openapi .models .V1ServiceSpec ;
3838import io .kubernetes .client .openapi .models .V1ServiceStatus ;
39- import org .junit .Before ;
40- import org .junit .Test ;
41- import org .junit .runner . RunWith ;
39+ import org .junit .jupiter . api . BeforeEach ;
40+ import org .junit .jupiter . api . Test ;
41+ import org .junit .jupiter . api . extension . ExtendWith ;
4242import org .mockito .Mock ;
43- import org .mockito .junit .MockitoJUnitRunner ;
43+ import org .mockito .junit .jupiter . MockitoExtension ;
4444
45- @ RunWith ( MockitoJUnitRunner .class )
45+ @ ExtendWith ( MockitoExtension .class )
4646public final class KubernetesLoadManagerNatManagerTest {
4747
4848 private final String detectedAdvertisedHost = "199.45.69.12" ;
@@ -54,7 +54,7 @@ public final class KubernetesLoadManagerNatManagerTest {
5454
5555 private KubernetesNatManager natManager ;
5656
57- @ Before
57+ @ BeforeEach
5858 public void initialize () throws IOException {
5959 final V1ServiceStatus v1ServiceStatus =
6060 new V1ServiceStatus ()
Original file line number Diff line number Diff line change 2121import io .kubernetes .client .openapi .models .V1ObjectMeta ;
2222import io .kubernetes .client .openapi .models .V1Service ;
2323import io .kubernetes .client .openapi .models .V1ServiceSpec ;
24- import org .junit .Before ;
25- import org .junit .Test ;
26- import org .junit .runner . RunWith ;
24+ import org .junit .jupiter . api . BeforeEach ;
25+ import org .junit .jupiter . api . Test ;
26+ import org .junit .jupiter . api . extension . ExtendWith ;
2727import org .mockito .Mock ;
28- import org .mockito .junit .MockitoJUnitRunner ;
28+ import org .mockito .junit .jupiter . MockitoExtension ;
2929
30- @ RunWith ( MockitoJUnitRunner .class )
30+ @ ExtendWith ( MockitoExtension .class )
3131public final class KubernetesUnknownNatManagerTest {
3232
3333 @ Mock private V1Service v1Service ;
3434
3535 private KubernetesNatManager natManager ;
3636
37- @ Before
37+ @ BeforeEach
3838 public void initialize () {
3939
4040 when (v1Service .getSpec ()).thenReturn (new V1ServiceSpec ().type ("Unknown" ));
Original file line number Diff line number Diff line change 3030import java .net .URI ;
3131import java .net .URL ;
3232
33- import org .junit .Before ;
34- import org .junit .Test ;
33+ import org .junit .jupiter . api . BeforeEach ;
34+ import org .junit .jupiter . api . Test ;
3535import org .jupnp .UpnpService ;
3636import org .jupnp .controlpoint .ControlPoint ;
3737import org .jupnp .model .meta .DeviceDetails ;
@@ -54,7 +54,7 @@ public final class UpnpNatManagerTest {
5454
5555 private UpnpNatManager upnpManager ;
5656
57- @ Before
57+ @ BeforeEach
5858 public void initialize () {
5959
6060 mockedRegistry = mock (Registry .class );
You can’t perform that action at this time.
0 commit comments