diff --git a/testcontainers-common/src/test/java/com/playtika/testcontainer/common/utils/MountVolumesTest.java b/testcontainers-common/src/test/java/com/playtika/testcontainer/common/utils/MountVolumesTest.java index 07cf0155c..91cbdd3ec 100644 --- a/testcontainers-common/src/test/java/com/playtika/testcontainer/common/utils/MountVolumesTest.java +++ b/testcontainers-common/src/test/java/com/playtika/testcontainer/common/utils/MountVolumesTest.java @@ -37,7 +37,7 @@ void noConfigurationEqualsEmptyList() { assertThat(it).hasSingleBean(CommonContainerProperties.class); CommonContainerProperties properties = it.getBean(CommonContainerProperties.class); assertThat(properties).isNotNull(); - assertThat(properties.getMountVolumes()).hasSize(0); + assertThat(properties.getMountVolumes()).isEmpty(); }); } @@ -71,7 +71,7 @@ void wrongModeFailsAtStartup() { .run(it -> { assertThat(it).hasFailed(); assertThat(it).getFailure().hasCauseExactlyInstanceOf(BindException.class); - assertThat(it).getFailure().getCause() + assertThat(it).getFailure().cause() .hasMessage("Failed to bind properties under 'embedded.postgresql.mount-volumes[0].mode' to org.testcontainers.containers.BindMode"); }); } @@ -82,8 +82,8 @@ void nullContainerPathFailsAtStartup() { .run(it -> { assertThat(it).hasFailed(); assertThat(it).getFailure().hasRootCauseExactlyInstanceOf(BindValidationException.class); - assertThat(it).getFailure().getRootCause() - .hasMessageContaining("on field 'containerPath': rejected value [null];"); + assertThat(it).getFailure().rootCause() + .hasMessageContaining("on field 'mountVolumes[0].containerPath': rejected value [null];"); }); } @@ -94,7 +94,7 @@ void emptyContainerPathFailsAtStartup() { .run(it -> { assertThat(it).hasFailed(); assertThat(it).getFailure().hasRootCauseExactlyInstanceOf(BindValidationException.class) - .getRootCause().hasMessageContaining("on field 'containerPath': rejected value [];"); + .rootCause().hasMessageContaining("on field 'mountVolumes[0].containerPath': rejected value [];"); }); } @@ -104,7 +104,7 @@ void nullHostPathFailsAtStartup() { .run(it -> { assertThat(it).hasFailed(); assertThat(it).getFailure().hasRootCauseExactlyInstanceOf(BindValidationException.class) - .getRootCause().hasMessageContaining("on field 'hostPath': rejected value [null];"); + .rootCause().hasMessageContaining("on field 'mountVolumes[0].hostPath': rejected value [null];"); }); } @@ -115,7 +115,7 @@ void emptyHostPathFailsAtStartup() { .run(it -> { assertThat(it).hasFailed(); assertThat(it).getFailure().hasRootCauseExactlyInstanceOf(BindValidationException.class) - .getRootCause().hasMessageContaining("on field 'hostPath': rejected value [];"); + .rootCause().hasMessageContaining("on field 'mountVolumes[0].hostPath': rejected value [];"); }); }