Skip to content

Commit

Permalink
(#243) Qulice compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed May 13, 2021
1 parent 12b8640 commit 7abf3fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/llorllale/cactoos/matchers/IsBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ protected boolean matchesSafely(
final byte[] presented = new UncheckedBytes(item).asBytes();
final byte[] expected = this.bytes.asBytes();
final boolean result;
if (!Arrays.equals(presented, expected)) {
if (Arrays.equals(presented, expected)) {
result = true;
} else {
description.appendValue(new IterableOfBytes(presented));
result = false;
} else {
result = true;
}
return result;
}
Expand Down
8 changes: 3 additions & 5 deletions src/test/java/org/llorllale/cactoos/matchers/IsBytesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
*/
package org.llorllale.cactoos.matchers;

import org.cactoos.Text;
import org.cactoos.bytes.BytesOf;
import org.cactoos.bytes.HexOf;
import org.cactoos.text.TextOf;
Expand All @@ -37,13 +36,12 @@
* @since 1.0.0
* @checkstyle MagicNumberCheck (500 lines)
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
final class IsBytesTest {

@Test
void matchesExactly() {
new Assertion<>(
"Must match",
"Must match with chars",
new BytesOf("ABC"),
new IsBytes('A', 'B', 'C')
).affirm();
Expand All @@ -52,7 +50,7 @@ void matchesExactly() {
@Test
void mismatches() {
new Assertion<>(
"Must mismatch",
"Must mismatch with bytes",
new IsBytes((byte) 65, (byte) 66, (byte) 67),
new Mismatches<>(
new BytesOf("abc"),
Expand All @@ -65,7 +63,7 @@ void mismatches() {
@Test
void matchesAsString() {
new Assertion<>(
"Must match",
"Must match with String",
new HexOf(new TextOf("6465616462656166")),
new IsBytes("deadbeaf")
).affirm();
Expand Down

0 comments on commit 7abf3fc

Please sign in to comment.