use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Paths_assertHasBinaryContent_Test method should_fail_if_actual_is_not_readable.
@Test
@DisabledOnOs(value = WINDOWS, disabledReason = "gh-2312")
void should_fail_if_actual_is_not_readable() throws IOException {
// GIVEN
Path actual = createFile(tempDir.resolve("actual"));
actual.toFile().setReadable(false);
byte[] expected = "expected".getBytes();
// WHEN
AssertionError error = expectAssertionError(() -> paths.assertHasBinaryContent(info, actual, expected));
// THEN
then(error).hasMessage(shouldBeReadable(actual).create());
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Paths_assertHasDigest_with_String_and_String_Test method should_fail_if_actual_is_not_readable.
@Test
@DisabledOnOs(value = WINDOWS, disabledReason = "gh-2312")
void should_fail_if_actual_is_not_readable() throws IOException {
// GIVEN
Path actual = createFile(tempDir.resolve("actual"));
actual.toFile().setReadable(false);
String algorithm = "MD5";
String expected = "";
// WHEN
AssertionError error = expectAssertionError(() -> paths.assertHasDigest(info, actual, algorithm, expected));
// THEN
then(error).hasMessage(shouldBeReadable(actual).create());
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Paths_assertHasSameBinaryContentAs_Test method should_fail_if_actual_is_not_readable.
@Test
@DisabledOnOs(value = WINDOWS, disabledReason = "gh-2312")
void should_fail_if_actual_is_not_readable() throws IOException {
// GIVEN
Path actual = createFile(tempDir.resolve("actual"));
actual.toFile().setReadable(false);
Path expected = createFile(tempDir.resolve("expected"));
// WHEN
AssertionError error = expectAssertionError(() -> paths.assertHasSameBinaryContentAs(info, actual, expected));
// THEN
then(error).hasMessage(shouldBeReadable(actual).create());
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Paths_assertHasDigest_with_String_and_Byte_array_Test method should_fail_if_actual_is_not_readable.
@Test
@DisabledOnOs(value = WINDOWS, disabledReason = "gh-2312")
void should_fail_if_actual_is_not_readable() throws IOException {
// GIVEN
Path actual = createFile(tempDir.resolve("actual"));
actual.toFile().setReadable(false);
String algorithm = "MD5";
byte[] expected = {};
// WHEN
AssertionError error = expectAssertionError(() -> paths.assertHasDigest(info, actual, algorithm, expected));
// THEN
then(error).hasMessage(shouldBeReadable(actual).create());
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Paths_assertHasDigest_with_MessageDigest_and_Byte_array_Test method should_fail_if_actual_is_not_readable.
@Test
@DisabledOnOs(value = WINDOWS, disabledReason = "gh-2312")
void should_fail_if_actual_is_not_readable() throws Exception {
// GIVEN
Path actual = createFile(tempDir.resolve("actual"));
actual.toFile().setReadable(false);
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] expected = {};
// WHEN
AssertionError error = expectAssertionError(() -> paths.assertHasDigest(info, actual, digest, expected));
// THEN
then(error).hasMessage(shouldBeReadable(actual).create());
}
Aggregations