Skip to content

Commit

Permalink
Removed duplicated literals
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciofx committed Jun 26, 2017
1 parent 3af1273 commit 9a7c524
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/test/java/org/cactoos/list/MapEntryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,24 @@
public final class MapEntryTest {

@Test
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public void getKey() {
final String key = "hello";
final String value = "world";
MatcherAssert.assertThat(
"Can't get key in the map entry",
new MapEntry<>("hello", "world").getKey(),
Matchers.equalTo("hello")
new MapEntry<>(key, value).getKey(),
Matchers.equalTo(key)
);
}

@Test
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public void getValue() {
final String key = "foo";
final String value = "bar";
MatcherAssert.assertThat(
"Can't get value in the map entry",
new MapEntry<>("foo", "bar").getValue(),
Matchers.equalTo("bar")
new MapEntry<>(key, value).getValue(),
Matchers.equalTo(value)
);
}

Expand All @@ -63,11 +65,12 @@ public void cantSetValue() {
}

@Test
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public void equalsTo() {
final String key = "eo";
final String value = "book";
MatcherAssert.assertThat(
"MapEntries are not equals",
new MapEntry<>("eo", "book").equals(new MapEntry<>("eo", "book")),
new MapEntry<>(key, value).equals(new MapEntry<>(key, value)),
Matchers.equalTo(true)
);
}
Expand Down

0 comments on commit 9a7c524

Please sign in to comment.