Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,14 @@
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-(test-)?sources/.*</arg>
<arg>-Xplugin:ErrorProne</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.49.0</version>
</path>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
Expand Down Expand Up @@ -120,11 +115,6 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<excludes>
<exclude>**/AutoValue_*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -176,7 +166,6 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<auto-value.version>1.11.1</auto-value.version>
<jacoco.version>0.8.14</jacoco.version>
</properties>

Expand All @@ -201,12 +190,6 @@
<artifactId>guice</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value-annotations</artifactId>
<version>${auto-value.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
Expand Down
20 changes: 5 additions & 15 deletions src/main/java/com/google/acai/GuiceberryCompatibilityModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.acai;

import com.google.auto.value.AutoValue;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Injector;
Expand All @@ -39,14 +38,14 @@
class GuiceberryCompatibilityModule extends AbstractModule {
private static final String GUICEBRRY_TEST_SCOPED_ANNOTATION = "com.google.guiceberry.TestScoped";
private static final MethodReference GUICEBERRY_ENV_MAIN_RUN =
MethodReference.create("com.google.guiceberry.GuiceBerryEnvMain", "run");
new MethodReference("com.google.guiceberry.GuiceBerryEnvMain", "run");
private static final MethodReference TEST_WRAPPER_RUN_BEFORE_TEST =
MethodReference.create("com.google.guiceberry.TestWrapper", "toRunBeforeTest");
new MethodReference("com.google.guiceberry.TestWrapper", "toRunBeforeTest");
private static final MethodReference TEST_SCOPE_LISTENER_ENTERING_SCOPE =
MethodReference.create(
new MethodReference(
"com.google.inject.testing.guiceberry.TestScopeListener", "enteringScope");
private static final MethodReference TEST_SCOPE_LISTENER_EXITING_SCOPE =
MethodReference.create(
new MethodReference(
"com.google.inject.testing.guiceberry.TestScopeListener", "exitingScope");

@Override
Expand Down Expand Up @@ -113,14 +112,5 @@ private static Optional<Class<?>> classForName(String className) {
}
}

@AutoValue
abstract static class MethodReference {
static MethodReference create(String className, String methodName) {
return new AutoValue_GuiceberryCompatibilityModule_MethodReference(className, methodName);
}

abstract String className();

abstract String methodName();
}
record MethodReference(String className, String methodName) {}
}
14 changes: 3 additions & 11 deletions src/test/java/com/google/acai/AcaiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import com.google.auto.value.AutoValue;
import com.google.common.testing.TearDownAccepter;
import com.google.inject.AbstractModule;
import com.google.inject.BindingAnnotation;
Expand Down Expand Up @@ -283,20 +282,13 @@ private void afterTest() {
}
}

@AutoValue
abstract static class MethodCalls {
abstract int beforeSuite();

abstract int beforeTest();

abstract int afterTest();

record MethodCalls(int beforeSuite, int beforeTest, int afterTest) {
static MethodCalls create() {
return new AutoValue_AcaiTest_MethodCalls(0, 0, 0);
return new MethodCalls(0, 0, 0);
}

static MethodCalls create(int beforeSuite, int beforeTest, int afterTest) {
return new AutoValue_AcaiTest_MethodCalls(beforeSuite, beforeTest, afterTest);
return new MethodCalls(beforeSuite, beforeTest, afterTest);
}

MethodCalls incrementBeforeSuite() {
Expand Down
Loading