Skip to content

Commit d97d51b

Browse files
committed
fix: spotless apply
1 parent 2230fcc commit d97d51b

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

core/src/test/java/org/testcontainers/containers/GenericContainerTest.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
import org.testcontainers.utility.MountableFile;
3333

3434
import java.time.Duration;
35-
import java.util.Arrays;
3635
import java.util.ArrayList;
36+
import java.util.Arrays;
3737
import java.util.Collections;
3838
import java.util.List;
3939
import java.util.Map;
@@ -44,14 +44,11 @@
4444

4545
import static org.assertj.core.api.Assertions.assertThat;
4646
import 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;
4849
import static org.rnorth.visibleassertions.VisibleAssertions.assertEquals;
4950
import static org.rnorth.visibleassertions.VisibleAssertions.assertNotNull;
50-
import static org.rnorth.visibleassertions.VisibleAssertions.assertThrows;
5151
import 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

5653
public 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

Comments
 (0)