File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed
docs/examples/junit4/generic/src/test/java/generic
modules/selenium/src/test/java/org/testcontainers/junit Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 11package generic ;
22
3+ import static org .slf4j .LoggerFactory .getLogger ;
4+
35import org .junit .Rule ;
46import org .junit .Test ;
57import org .slf4j .Logger ;
68import org .testcontainers .containers .GenericContainer ;
79import org .testcontainers .containers .output .Slf4jLogConsumer ;
810import org .testcontainers .utility .DockerImageName ;
911
10- import static org .slf4j .LoggerFactory .getLogger ;
11-
1212public class MultiplePortsExposedTest {
1313 private static final Logger log = getLogger (MultiplePortsExposedTest .class );
1414
1515
1616 @ Rule
1717 // rule {
18- public GenericContainer container = new GenericContainer (DockerImageName .parse ("orientdb:3.0.13 " ))
19- .withExposedPorts (2424 , 2480 )
18+ public GenericContainer <?> container = new GenericContainer <> (DockerImageName .parse ("testcontainers/helloworld:1.1.0 " ))
19+ .withExposedPorts (8080 , 8081 )
2020 .withLogConsumer (new Slf4jLogConsumer (log ));
2121 // }
2222
2323 @ Test
2424 public void fetchPortsByNumber () {
25- Integer firstMappedPort = container .getMappedPort (2424 );
26- Integer secondMappedPort = container .getMappedPort (2480 );
25+ Integer firstMappedPort = container .getMappedPort (8080 );
26+ Integer secondMappedPort = container .getMappedPort (8081 );
2727 }
2828
2929 @ Test
@@ -39,6 +39,6 @@ public void getHostOnly() {
3939 @ Test
4040 public void getHostAndMappedPort () {
4141 String address =
42- container .getHost () + ":" + container .getMappedPort (2424 );
42+ container .getHost () + ":" + container .getMappedPort (8080 );
4343 }
4444}
Original file line number Diff line number Diff line change 11package org .testcontainers .junit ;
22
3+ import static java .lang .String .format ;
4+ import static org .rnorth .visibleassertions .VisibleAssertions .assertEquals ;
5+ import static org .rnorth .visibleassertions .VisibleAssertions .assertTrue ;
6+
7+ import java .util .concurrent .TimeUnit ;
38import org .jetbrains .annotations .NotNull ;
49import org .junit .ClassRule ;
510import org .openqa .selenium .By ;
1116import org .testcontainers .containers .wait .strategy .HttpWaitStrategy ;
1217import org .testcontainers .utility .DockerImageName ;
1318
14- import java .util .concurrent .TimeUnit ;
15-
16- import static java .lang .String .format ;
17- import static org .rnorth .visibleassertions .VisibleAssertions .assertEquals ;
18- import static org .rnorth .visibleassertions .VisibleAssertions .assertTrue ;
19-
2019/**
2120 *
2221 */
@@ -26,7 +25,7 @@ public class BaseWebDriverContainerTest {
2625 public static Network NETWORK = Network .newNetwork ();
2726
2827 @ ClassRule
29- public static GenericContainer <?> HELLO_WORLD = new GenericContainer <>(DockerImageName .parse ("testcontainers/helloworld:1.0 .0" ))
28+ public static GenericContainer <?> HELLO_WORLD = new GenericContainer <>(DockerImageName .parse ("testcontainers/helloworld:1.1 .0" ))
3029 .withNetwork (NETWORK )
3130 .withNetworkAliases ("helloworld" )
3231 .withExposedPorts (8080 , 8081 )
You can’t perform that action at this time.
0 commit comments