diff --git a/pom.xml b/pom.xml
index d65f4b3..41cbeb7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,10 +59,11 @@
3.14.0
26
+ true
-XDcompilePolicy=simple
--should-stop=ifError=FLOW
- -Xplugin:ErrorProne
+ -Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-(test-)?sources/.*
@@ -95,6 +96,9 @@
org.apache.maven.plugins
maven-javadoc-plugin
3.12.0
+
+ true
+
attach-javadocs
diff --git a/src/test/java/com/google/acai/AcaiTest.java b/src/test/java/com/google/acai/AcaiTest.java
index 5b161ca..fb9699f 100644
--- a/src/test/java/com/google/acai/AcaiTest.java
+++ b/src/test/java/com/google/acai/AcaiTest.java
@@ -313,6 +313,7 @@ MethodCalls incrementAfterTest() {
}
private static class TestWithUnsatisfiedBinding {
+ @SuppressWarnings("unused") // Fixture: injection should fail before this is read.
@Inject @TestBindingAnnotation ExampleTest unsatisfiedBinding;
}
@@ -342,6 +343,8 @@ protected void configureTestingServices() {
}
}
+ // Fixture: existence of the non-zero-arg constructor is what the test verifies.
+ @SuppressWarnings("unused")
private static class ModuleWithoutZeroArgumentConstructor extends AbstractModule {
ModuleWithoutZeroArgumentConstructor(String argument) {
// No-op.
@@ -381,6 +384,7 @@ String provideValueAndAddTearDown(TearDownAccepter tearDownAccepter) {
}
private static class TearDownAccepterTest {
+ @SuppressWarnings("unused") // Forces @Provides to fire so the teardown is registered.
@Inject @TestBindingAnnotation String injected;
}
diff --git a/src/test/java/com/google/acai/GuiceberryCompatibilityModuleTest.java b/src/test/java/com/google/acai/GuiceberryCompatibilityModuleTest.java
index 9b99cc4..5db591f 100644
--- a/src/test/java/com/google/acai/GuiceberryCompatibilityModuleTest.java
+++ b/src/test/java/com/google/acai/GuiceberryCompatibilityModuleTest.java
@@ -131,21 +131,19 @@ public void evaluate() {
@Test
public void testWrapperExceptionPropagated() {
FakeTestClass test = new FakeTestClass();
-
- assertThrows(
- TestException.class,
- () ->
- new Acai(ThrowingWrapperModule.class)
- .apply(
- new Statement() {
- @Override
- public void evaluate() {
- assertWithMessage("Test should not run when TestWrapper throws").fail();
- }
- },
- frameworkMethod,
- test)
- .evaluate());
+ Statement statement =
+ new Acai(ThrowingWrapperModule.class)
+ .apply(
+ new Statement() {
+ @Override
+ public void evaluate() {
+ assertWithMessage("Test should not run when TestWrapper throws").fail();
+ }
+ },
+ frameworkMethod,
+ test);
+
+ assertThrows(TestException.class, statement::evaluate);
}
private static class FakeTestClass {
diff --git a/src/test/java/com/google/acai/TestScopeTest.java b/src/test/java/com/google/acai/TestScopeTest.java
index 6b490e5..ac69559 100644
--- a/src/test/java/com/google/acai/TestScopeTest.java
+++ b/src/test/java/com/google/acai/TestScopeTest.java
@@ -253,6 +253,7 @@ private static class FakeTestClassWithProvider {
private static class MyTestScopedClass {}
private static class InvalidTestingService implements TestingService {
+ @SuppressWarnings("unused") // Fixture: @TestScoped injected into a TestingService is rejected.
@Inject MyTestScopedClass testScoped;
}
diff --git a/src/test/java/com/google/acai/TestingServiceManagerTest.java b/src/test/java/com/google/acai/TestingServiceManagerTest.java
index 6b10b7f..3a11624 100644
--- a/src/test/java/com/google/acai/TestingServiceManagerTest.java
+++ b/src/test/java/com/google/acai/TestingServiceManagerTest.java
@@ -150,6 +150,7 @@ private void incrementPrivateBeforeTestCount() {
}
@BeforeTest
+ @SuppressWarnings("unused") // Parameter is the whole point: makes the method ineligible.
private void incrementBeforeTestWithParameterCount(int someParameter) {
beforeTestWithParameterCount++;
}