3232import org .testcontainers .utility .MountableFile ;
3333
3434import java .time .Duration ;
35- import java .util .Arrays ;
3635import java .util .ArrayList ;
36+ import java .util .Arrays ;
3737import java .util .Collections ;
3838import java .util .List ;
3939import java .util .Map ;
4444
4545import static org .assertj .core .api .Assertions .assertThat ;
4646import static org .assertj .core .api .Assertions .assertThatThrownBy ;
47- import static org .hamcrest .CoreMatchers .equalTo ;
47+ import static org .assertj .core .api .Assertions .catchThrowable ;
48+ import static org .assertj .core .api .Assumptions .assumeThat ;
4849import static org .rnorth .visibleassertions .VisibleAssertions .assertEquals ;
4950import static org .rnorth .visibleassertions .VisibleAssertions .assertNotNull ;
50- import static org .rnorth .visibleassertions .VisibleAssertions .assertThrows ;
5151import static org .rnorth .visibleassertions .VisibleAssertions .assertTrue ;
52- import static org .testcontainers .TestImages .TINY_IMAGE ;
53- import static org .assertj .core .api .Assertions .catchThrowable ;
54- import static org .assertj .core .api .Assumptions .assumeThat ;
5552
5653public class GenericContainerTest {
5754
@@ -242,12 +239,9 @@ public void testArchitectureCheck() {
242239 @ Test
243240 public void shouldHonorUDPPorts () {
244241 ImageFromDockerfile image = new ImageFromDockerfile ("publish-multiple" )
245- .withDockerfileFromBuilder (builder ->
246- builder
247- .from ("testcontainers/helloworld:1.1.0" )
248- .expose (8080 , 8081 )
249- .build ()
250- );
242+ .withDockerfileFromBuilder (builder ->
243+ builder .from ("testcontainers/helloworld:1.1.0" ).expose (8080 , 8081 ).build ()
244+ );
251245
252246 try (
253247 GenericContainer container = new GenericContainer <>(image )
@@ -265,20 +259,25 @@ public void shouldHonorUDPPorts() {
265259 Ports ports = cmd .getPortBindings ();
266260 ports .bind (ExposedPort .udp (99 ), Ports .Binding .empty ());
267261 cmd .withPortBindings (ports );
268- }
269- )
262+ })
270263 ) {
271-
272264 container .start ();
273265 ExposedPort expectedPort = ExposedPort .udp (99 );
274- Map <ExposedPort , Ports .Binding []> map = container .getContainerInfo ().getNetworkSettings ().getPorts ().getBindings ();
266+ Map <ExposedPort , Ports .Binding []> map = container
267+ .getContainerInfo ()
268+ .getNetworkSettings ()
269+ .getPorts ()
270+ .getBindings ();
275271
276272 assertEquals ("Two TCP ports should have been exposed." , 2 , container .getExposedPorts ().size ());
277273 assertNotNull ("withExposedPorts should have exposed UDP port" , map .get (expectedPort ));
278- assertTrue ("UDP port 99 should have been mapped to a different port" , 99 != Integer .valueOf (map .get (expectedPort )[0 ].getHostPortSpec ()));
274+ assertTrue (
275+ "UDP port 99 should have been mapped to a different port" ,
276+ 99 != Integer .valueOf (map .get (expectedPort )[0 ].getHostPortSpec ())
277+ );
279278 }
280279 }
281-
280+
282281 @ Test
283282 public void shouldReturnTheProvidedImage () {
284283 GenericContainer container = new GenericContainer (TestImages .REDIS_IMAGE );
0 commit comments