File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
src/test/java/org/testcontainers/containers Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,20 @@ dependencies {
66
77 testImplementation ' redis.clients:jedis:6.1.0'
88 testImplementation ' org.assertj:assertj-core:3.27.4'
9+ testImplementation project(" :testcontainers-junit-jupiter" )
10+ testImplementation platform(' org.junit:junit-bom:5.13.4' )
11+ testImplementation ' org.junit.jupiter:junit-jupiter-api'
12+ testImplementation ' org.junit.jupiter:junit-jupiter-params'
13+ testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine'
14+ testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
915}
1016
1117tasks. japicmp {
1218 classExcludes = [
1319 " org.testcontainers.containers.ToxiproxyContainer"
1420 ]
1521}
22+
23+ tasks. withType(Test ). configureEach {
24+ useJUnitPlatform()
25+ }
Original file line number Diff line number Diff line change 33import eu .rekawek .toxiproxy .Proxy ;
44import eu .rekawek .toxiproxy .ToxiproxyClient ;
55import eu .rekawek .toxiproxy .model .ToxicDirection ;
6- import org .junit .Rule ;
7- import org .junit .Test ;
6+ import org .junit .jupiter . api . Test ;
7+ import org .testcontainers . junit .jupiter . ManagedNetwork ;
88import redis .clients .jedis .Jedis ;
99import redis .clients .jedis .exceptions .JedisConnectionException ;
1010
@@ -22,18 +22,18 @@ public class ToxiproxyTest {
2222 // spotless:off
2323 // creatingProxy {
2424 // Create a common docker network so that containers can communicate
25- @ Rule
25+ @ ManagedNetwork
2626 public Network network = Network .newNetwork ();
2727
2828 // The target container - this could be anything
29- @ Rule
29+ @ org . testcontainers . junit . jupiter . Container
3030 public GenericContainer <?> redis = new GenericContainer <>("redis:6-alpine" )
3131 .withExposedPorts (6379 )
3232 .withNetwork (network )
3333 .withNetworkAliases ("redis" );
3434
3535 // Toxiproxy container, which will be used as a TCP proxy
36- @ Rule
36+ @ org . testcontainers . junit . jupiter . Container
3737 public ToxiproxyContainer toxiproxy = new ToxiproxyContainer ("ghcr.io/shopify/toxiproxy:2.5.0" )
3838 .withNetwork (network );
3939 // }
You can’t perform that action at this time.
0 commit comments