From ed807b5c7a946ad68542b7fbfbeec57c49f673ec Mon Sep 17 00:00:00 2001 From: Dagger Team Date: Fri, 9 Aug 2024 10:14:26 -0700 Subject: [PATCH] Update Kotlinc to v2_0_10 PiperOrigin-RevId: 661309748 --- .../DaggerSuperficialValidationTest.java | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/javatests/dagger/internal/codegen/DaggerSuperficialValidationTest.java b/javatests/dagger/internal/codegen/DaggerSuperficialValidationTest.java index 7092047a856..94db789822e 100644 --- a/javatests/dagger/internal/codegen/DaggerSuperficialValidationTest.java +++ b/javatests/dagger/internal/codegen/DaggerSuperficialValidationTest.java @@ -467,18 +467,17 @@ public void invalidAnnotationValue() { () -> superficialValidation.validateElement(testClassElement)); // TODO(b/248552462): Javac and KSP should match once this bug is fixed. boolean isJavac = processingEnv.getBackend() == XProcessingEnv.Backend.JAVAC; - assertThat(exception) - .hasMessageThat() - .contains( - String.format( - NEW_LINES.join( - "Validation trace:", - " => element (CLASS): test.Outer.TestClass", - " => annotation type: test.Outer.TestAnnotation", - " => annotation: @test.Outer.TestAnnotation(classes={<%1$s>})", - " => annotation value (TYPE_ARRAY): classes={<%1$s>}", - " => annotation value (TYPE): classes=<%1$s>"), - isJavac ? "error" : "Error")); + String expectedMessage = + String.format( + NEW_LINES.join( + "Validation trace:", + " => element (CLASS): test.Outer.TestClass", + " => annotation type: test.Outer.TestAnnotation", + " => annotation: @test.Outer.TestAnnotation(classes={<%1$s>})", + " => annotation value (TYPE_ARRAY): classes={<%1$s>}", + " => annotation value (TYPE): classes=<%1$s>"), + isJavac ? "error" : "Error"); + assertThat(exception).hasMessageThat().contains(expectedMessage); }); } @@ -527,20 +526,19 @@ public void invalidAnnotationValueOnParameter() { () -> superficialValidation.validateElement(parameter)); // TODO(b/248552462): Javac and KSP should match once this bug is fixed. boolean isJavac = processingEnv.getBackend() == XProcessingEnv.Backend.JAVAC; - assertThat(exception) - .hasMessageThat() - .contains( - String.format( - NEW_LINES.join( - "Validation trace:", - " => element (CLASS): test.Outer.TestClass", - " => element (CONSTRUCTOR): TestClass(java.lang.String)", - " => element (PARAMETER): strParam", - " => annotation type: test.Outer.TestAnnotation", - " => annotation: @test.Outer.TestAnnotation(classes={<%1$s>})", - " => annotation value (TYPE_ARRAY): classes={<%1$s>}", - " => annotation value (TYPE): classes=<%1$s>"), - isJavac ? "error" : "Error")); + String expectedMessage = + String.format( + NEW_LINES.join( + "Validation trace:", + " => element (CLASS): test.Outer.TestClass", + " => element (CONSTRUCTOR): TestClass(java.lang.String)", + " => element (PARAMETER): strParam", + " => annotation type: test.Outer.TestAnnotation", + " => annotation: @test.Outer.TestAnnotation(classes={<%1$s>})", + " => annotation value (TYPE_ARRAY): classes={<%1$s>}", + " => annotation value (TYPE): classes=<%1$s>"), + isJavac ? "error" : "Error"); + assertThat(exception).hasMessageThat().contains(expectedMessage); }); }