@@ -467,18 +467,17 @@ public void invalidAnnotationValue() {
467
467
() -> superficialValidation .validateElement (testClassElement ));
468
468
// TODO(b/248552462): Javac and KSP should match once this bug is fixed.
469
469
boolean isJavac = processingEnv .getBackend () == XProcessingEnv .Backend .JAVAC ;
470
- assertThat (exception )
471
- .hasMessageThat ()
472
- .contains (
473
- String .format (
474
- NEW_LINES .join (
475
- "Validation trace:" ,
476
- " => element (CLASS): test.Outer.TestClass" ,
477
- " => annotation type: test.Outer.TestAnnotation" ,
478
- " => annotation: @test.Outer.TestAnnotation(classes={<%1$s>})" ,
479
- " => annotation value (TYPE_ARRAY): classes={<%1$s>}" ,
480
- " => annotation value (TYPE): classes=<%1$s>" ),
481
- isJavac ? "error" : "Error" ));
470
+ String expectedMessage =
471
+ String .format (
472
+ NEW_LINES .join (
473
+ "Validation trace:" ,
474
+ " => element (CLASS): test.Outer.TestClass" ,
475
+ " => annotation type: test.Outer.TestAnnotation" ,
476
+ " => annotation: @test.Outer.TestAnnotation(classes={<%1$s>})" ,
477
+ " => annotation value (TYPE_ARRAY): classes={<%1$s>}" ,
478
+ " => annotation value (TYPE): classes=<%1$s>" ),
479
+ isJavac ? "error" : "Error" );
480
+ assertThat (exception ).hasMessageThat ().contains (expectedMessage );
482
481
});
483
482
}
484
483
@@ -527,20 +526,19 @@ public void invalidAnnotationValueOnParameter() {
527
526
() -> superficialValidation .validateElement (parameter ));
528
527
// TODO(b/248552462): Javac and KSP should match once this bug is fixed.
529
528
boolean isJavac = processingEnv .getBackend () == XProcessingEnv .Backend .JAVAC ;
530
- assertThat (exception )
531
- .hasMessageThat ()
532
- .contains (
533
- String .format (
534
- NEW_LINES .join (
535
- "Validation trace:" ,
536
- " => element (CLASS): test.Outer.TestClass" ,
537
- " => element (CONSTRUCTOR): TestClass(java.lang.String)" ,
538
- " => element (PARAMETER): strParam" ,
539
- " => annotation type: test.Outer.TestAnnotation" ,
540
- " => annotation: @test.Outer.TestAnnotation(classes={<%1$s>})" ,
541
- " => annotation value (TYPE_ARRAY): classes={<%1$s>}" ,
542
- " => annotation value (TYPE): classes=<%1$s>" ),
543
- isJavac ? "error" : "Error" ));
529
+ String expectedMessage =
530
+ String .format (
531
+ NEW_LINES .join (
532
+ "Validation trace:" ,
533
+ " => element (CLASS): test.Outer.TestClass" ,
534
+ " => element (CONSTRUCTOR): TestClass(java.lang.String)" ,
535
+ " => element (PARAMETER): strParam" ,
536
+ " => annotation type: test.Outer.TestAnnotation" ,
537
+ " => annotation: @test.Outer.TestAnnotation(classes={<%1$s>})" ,
538
+ " => annotation value (TYPE_ARRAY): classes={<%1$s>}" ,
539
+ " => annotation value (TYPE): classes=<%1$s>" ),
540
+ isJavac ? "error" : "Error" );
541
+ assertThat (exception ).hasMessageThat ().contains (expectedMessage );
544
542
});
545
543
}
546
544
0 commit comments