From 9a7c5247eb9ed6ad9b88444839f67fe8e4f050dd Mon Sep 17 00:00:00 2001 From: Fabricio Cabral Date: Fri, 23 Jun 2017 17:25:07 -0300 Subject: [PATCH] Removed duplicated literals --- .../java/org/cactoos/list/MapEntryTest.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/cactoos/list/MapEntryTest.java b/src/test/java/org/cactoos/list/MapEntryTest.java index 9d05cb6db7..0560c3e8ba 100644 --- a/src/test/java/org/cactoos/list/MapEntryTest.java +++ b/src/test/java/org/cactoos/list/MapEntryTest.java @@ -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) ); } @@ -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) ); }