From 4a723aab1782e10bacac4ba8a60db750495b2329 Mon Sep 17 00:00:00 2001 From: CEL Dev Team Date: Tue, 13 Feb 2024 10:26:17 -0800 Subject: [PATCH] No public description PiperOrigin-RevId: 606668350 --- WORKSPACE | 2 +- .../dev/cel/common/testing/RepeatedTestProvider.java | 6 +++--- .../test/java/dev/cel/parser/CelUnparserImplTest.java | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index d2cd4795..f7b21a71 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -68,7 +68,7 @@ maven_install( "com.google.protobuf:protobuf-java:3.24.4", "com.google.protobuf:protobuf-java-util:3.24.4", "com.google.re2j:re2j:1.7", - "com.google.testparameterinjector:test-parameter-injector:1.14", + "com.google.testparameterinjector:test-parameter-injector:1.15", "com.google.truth.extensions:truth-java8-extension:1.4.0", "com.google.truth.extensions:truth-proto-extension:1.4.0", "com.google.truth:truth:1.4.0", diff --git a/common/src/main/java/dev/cel/common/testing/RepeatedTestProvider.java b/common/src/main/java/dev/cel/common/testing/RepeatedTestProvider.java index a8502e0b..974c504b 100644 --- a/common/src/main/java/dev/cel/common/testing/RepeatedTestProvider.java +++ b/common/src/main/java/dev/cel/common/testing/RepeatedTestProvider.java @@ -18,7 +18,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; -import com.google.testing.junit.testparameterinjector.TestParameter.TestParameterValuesProvider; +import com.google.testing.junit.testparameterinjector.TestParameterValuesProvider; import dev.cel.common.annotations.Internal; import java.util.stream.IntStream; @@ -34,11 +34,11 @@ */ @Internal @VisibleForTesting -public final class RepeatedTestProvider implements TestParameterValuesProvider { +public final class RepeatedTestProvider extends TestParameterValuesProvider { private static final int REPEATED_TEST_RUN_COUNT = 50; @Override - public ImmutableList provideValues() { + public ImmutableList provideValues(Context context) { return IntStream.rangeClosed(1, REPEATED_TEST_RUN_COUNT).boxed().collect(toImmutableList()); } } diff --git a/parser/src/test/java/dev/cel/parser/CelUnparserImplTest.java b/parser/src/test/java/dev/cel/parser/CelUnparserImplTest.java index 8eb31256..86fb279c 100644 --- a/parser/src/test/java/dev/cel/parser/CelUnparserImplTest.java +++ b/parser/src/test/java/dev/cel/parser/CelUnparserImplTest.java @@ -18,8 +18,8 @@ import static org.junit.Assert.assertThrows; import com.google.testing.junit.testparameterinjector.TestParameter; -import com.google.testing.junit.testparameterinjector.TestParameter.TestParameterValuesProvider; import com.google.testing.junit.testparameterinjector.TestParameterInjector; +import com.google.testing.junit.testparameterinjector.TestParameterValuesProvider; import dev.cel.common.CelAbstractSyntaxTree; import dev.cel.common.CelOptions; import dev.cel.common.CelProtoAbstractSyntaxTree; @@ -46,9 +46,9 @@ public final class CelUnparserImplTest { private final CelUnparserImpl unparser = new CelUnparserImpl(); - private static final class ValidExprDataProvider implements TestParameterValuesProvider { + private static final class ValidExprDataProvider extends TestParameterValuesProvider { @Override - public List provideValues() { + public List provideValues(Context context) { return Arrays.asList( "a + b - c", "a && b && c && d && e", @@ -182,9 +182,9 @@ public void unparse_succeeds( .isEqualTo(CelProtoAbstractSyntaxTree.fromCelAst(astOne).toParsedExpr()); } - private static final class InvalidExprDataProvider implements TestParameterValuesProvider { + private static final class InvalidExprDataProvider extends TestParameterValuesProvider { @Override - public List provideValues() { + public List provideValues(Context context) { return Arrays.asList( CelExpr.newBuilder().build(), // empty expr CelExpr.newBuilder()