Skip to content

Commit

Permalink
test: Fix Iterable assertions (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss authored Feb 21, 2019
1 parent 59455b7 commit 9b4c18a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ public void testConsumeItems() {
Optional.empty(), Optional.of(item2.build()),
Optional.of(item3.build()), Optional.empty()
}, 4, Optional[].class));
assertThat(cg.iterator()).hasSize(2).containsExactly(item2.build(), item3.build());
assertThat(cg).hasSize(2).containsExactly(item2.build(), item3.build());
recipe.consumeItems(cg);
assertThat(cg.stream().iterator()).isEmpty();
assertThat(cg).isEmpty();
}

@Test
Expand All @@ -100,9 +100,9 @@ public void testConsumeItemsMirrored() {
Optional.of(item2.build()), Optional.empty(),
Optional.empty(), Optional.of(item3.build())
}, 4, Optional[].class));
assertThat(cg.iterator()).hasSize(2).containsExactly(item2.build(), item3.build());
assertThat(cg).hasSize(2).containsExactly(item2.build(), item3.build());
recipe.consumeItems(cg);
assertThat(cg.stream().iterator()).isEmpty();
assertThat(cg).isEmpty();
}

@Test(expected = IllegalArgumentException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public void testConsumeItems() {
Optional.empty(), Optional.of(item3.build()),
Optional.of(item2.build()), Optional.empty()
}, 4, Optional[].class));
assertThat(cg.iterator()).hasSize(2).containsExactly(item3.build(), item2.build());
assertThat(cg).hasSize(2).containsExactly(item3.build(), item2.build());
recipe.consumeItems(cg);
assertThat(cg.stream().iterator()).isEmpty();
assertThat(cg).isEmpty();
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/nova/core/util/RegistryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void testRegistry() throws Exception {
assertThat(registry.get("ID1").get()).isEqualTo(id1);
assertThat(registry.get("ID2").get()).isEqualTo(id2);

assertThat(registry.iterator()).containsOnly(id1, id2);
assertThat(registry).containsOnly(id1, id2);

assertThat(registry.get("None").isPresent()).isFalse();

Expand Down

0 comments on commit 9b4c18a

Please sign in to comment.