Skip to content

Commit

Permalink
Fix error message assert
Browse files Browse the repository at this point in the history
  • Loading branch information
admitrov committed Dec 30, 2024
1 parent 294d42e commit a0700cc
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}

Expand Down Expand Up @@ -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");
});
}
Expand All @@ -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];");
});
}

Expand All @@ -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 [];");
});
}

Expand All @@ -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];");
});
}

Expand All @@ -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 [];");
});
}

Expand Down

0 comments on commit a0700cc

Please sign in to comment.