diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJMapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJMapTemplates.java index b165bfdb12..5a54b59d1e 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJMapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJMapTemplates.java @@ -21,7 +21,7 @@ static final class AbstractMapAssertContainsExactlyEntriesOf { } } - static final class AbstractMapAssertContainsEntry { + static final class AbstractMapAssertContainsOnly { @BeforeTemplate AbstractMapAssert before(AbstractMapAssert mapAssert, K key, V value) { return mapAssert.containsExactlyInAnyOrderEntriesOf(ImmutableMap.of(key, value)); @@ -29,7 +29,7 @@ static final class AbstractMapAssertContainsEntry { @AfterTemplate AbstractMapAssert after(AbstractMapAssert mapAssert, K key, V value) { - return mapAssert.containsExactly(Map.entry(key, value)); + return mapAssert.containsOnly(Map.entry(key, value)); } } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJMapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJMapTemplatesTestInput.java index 4cf4570d29..3739c50599 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJMapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJMapTemplatesTestInput.java @@ -10,7 +10,7 @@ final class AssertJMapTemplatesTest implements RefasterTemplateTestCase { return assertThat(ImmutableMap.of(1, 2, 3, 4)).isEqualTo(ImmutableMap.of(1, 2, 3, 4)); } - AbstractMapAssert testAbstractMapAssertContainsEntry() { + AbstractMapAssert testAbstractMapAssertContainsOnly() { return assertThat(ImmutableMap.of(1, 2)) .containsExactlyInAnyOrderEntriesOf(ImmutableMap.of(1, 2)); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJMapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJMapTemplatesTestOutput.java index 2967f34d96..d2fd29410f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJMapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJMapTemplatesTestOutput.java @@ -12,7 +12,7 @@ final class AssertJMapTemplatesTest implements RefasterTemplateTestCase { .containsExactlyInAnyOrderEntriesOf(ImmutableMap.of(1, 2, 3, 4)); } - AbstractMapAssert testAbstractMapAssertContainsEntry() { - return assertThat(ImmutableMap.of(1, 2)).containsExactly(Map.entry(1, 2)); + AbstractMapAssert testAbstractMapAssertContainsOnly() { + return assertThat(ImmutableMap.of(1, 2)).containsOnly(Map.entry(1, 2)); } }