Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump versions.errorprone from 2.7.1 to 2.8.0 #2365

Merged
merged 2 commits into from Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Expand Up @@ -6,7 +6,7 @@ def versions = [:]

versions.bytebuddy = '1.11.8'
versions.junitJupiter = '5.7.2'
versions.errorprone = '2.7.1'
versions.errorprone = '2.8.0'

libraries.junit4 = 'junit:junit:4.13.2'
libraries.junitJupiterApi = "org.junit.jupiter:junit-jupiter-api:${versions.junitJupiter}"
Expand Down
Expand Up @@ -114,7 +114,7 @@ public void toArray_just_work() throws Exception {

@Test(expected = CloneNotSupportedException.class)
public void cloneIsNotSupported() throws CloneNotSupportedException {
HashCodeAndEqualsSafeSet.of().clone();
Object ignored = HashCodeAndEqualsSafeSet.of().clone();
}

@Test
Expand Down
Expand Up @@ -43,6 +43,6 @@ public Object answer(InvocationOnMock invocation) throws Throwable {
}
});

test.toString();
String ignored = test.toString();
}
}
24 changes: 12 additions & 12 deletions src/test/java/org/mockitousage/misuse/InvalidUsageTest.java
Expand Up @@ -108,9 +108,9 @@ interface ObjectLikeInterface {
public void shouldNotMockObjectMethodsOnInterface() throws Exception {
ObjectLikeInterface inter = mock(ObjectLikeInterface.class);

inter.equals(null);
inter.toString();
inter.hashCode();
Object ignored = inter.equals(null);
ignored = inter.toString();
ignored = inter.hashCode();

verifyZeroInteractions(inter);
}
Expand All @@ -119,9 +119,9 @@ public void shouldNotMockObjectMethodsOnInterface() throws Exception {
public void shouldNotMockObjectMethodsOnInterfaceVerifyNoInteractions() throws Exception {
ObjectLikeInterface inter = mock(ObjectLikeInterface.class);

inter.equals(null);
inter.toString();
inter.hashCode();
Object ignored = inter.equals(null);
ignored = inter.toString();
ignored = inter.hashCode();

verifyNoInteractions(inter);
}
Expand All @@ -130,9 +130,9 @@ public void shouldNotMockObjectMethodsOnInterfaceVerifyNoInteractions() throws E
public void shouldNotMockObjectMethodsOnClass() throws Exception {
Object clazz = mock(ObjectLikeInterface.class);

clazz.equals(null);
clazz.toString();
clazz.hashCode();
Object ignored = clazz.equals(null);
ignored = clazz.toString();
ignored = clazz.hashCode();

verifyZeroInteractions(clazz);
}
Expand All @@ -141,9 +141,9 @@ public void shouldNotMockObjectMethodsOnClass() throws Exception {
public void shouldNotMockObjectMethodsOnClassVerifyNoInteractions() throws Exception {
Object clazz = mock(ObjectLikeInterface.class);

clazz.equals(null);
clazz.toString();
clazz.hashCode();
Object ignored = clazz.equals(null);
ignored = clazz.toString();
ignored = clazz.hashCode();

verifyNoInteractions(clazz);
}
Expand Down
Expand Up @@ -17,7 +17,7 @@ public void using_stub_only_wont_thrown_an_OutOfMemoryError() {
when(obj.toString()).thenReturn("asdf");

for (int i = 0; i < 1000000; i++) {
obj.toString();
String ignored = obj.toString();
}
}

Expand All @@ -28,7 +28,7 @@ public void without_stub_only_mocks_will_store_invocations_leading_to_an_OutOfMe
when(obj.toString()).thenReturn("asdf");

for (int i = 0; i < 1000000; i++) {
obj.toString();
String ignored = obj.toString();
}
}
}
Expand Up @@ -119,7 +119,7 @@ public void shouldNotThrowSmartNullPointerOnToString() {
@Test
public void shouldNotThrowSmartNullPointerOnObjectMethods() {
Object smartNull = mock.objectReturningMethod();
smartNull.toString();
String ignored = smartNull.toString();
}

@Test
Expand Down