Skip to content

Commit 2162d6d

Browse files
mtiidlaakarnokd
authored andcommitted
1.x Use IntelliJ IDE friendly assertion failure message (#5258)
* Test Intellij formatting fix * Fix test subscriber test case
1 parent bc40a84 commit 2162d6d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/rx/observers/TestSubscriber.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,11 @@ private void assertItem(T expected, int i) {
337337
if (expected == null) {
338338
// check for null equality
339339
if (actual != null) {
340-
assertionError("Value at index: " + i + " expected to be [null] but was: [" + actual + "]\n");
340+
assertionError("Value at index: " + i + " expected: [null] but was: [" + actual + "]\n");
341341
}
342342
} else if (!expected.equals(actual)) {
343343
assertionError("Value at index: " + i
344-
+ " expected to be [" + expected + "] (" + expected.getClass().getSimpleName()
344+
+ " expected: [" + expected + "] (" + expected.getClass().getSimpleName()
345345
+ ") but was: [" + actual + "] (" + (actual != null ? actual.getClass().getSimpleName() : "null") + ")\n");
346346

347347
}

src/test/java/rx/observers/TestSubscriberTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void testAssertNotMatchValue() {
7272
oi.subscribe(o);
7373

7474
thrown.expect(AssertionError.class);
75-
thrown.expectMessage("Value at index: 1 expected to be [3] (Integer) but was: [2] (Integer)");
75+
thrown.expectMessage("Value at index: 1 expected: [3] (Integer) but was: [2] (Integer)");
7676

7777

7878
o.assertReceivedOnNext(Arrays.asList(1, 3));

0 commit comments

Comments
 (0)