Skip to content

Commit

Permalink
Remove JSR250 annotations from AutoValue tests, and use @deprecated f…
Browse files Browse the repository at this point in the history
…or testing copying annotations instead of one from javax.annotations.

RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180717772
  • Loading branch information
netdpb authored and ronshapiro committed Jan 8, 2018
1 parent 8d0cf84 commit d6badd2
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ private void assertGeneratedMatches(
@Test
public void testSimpleAnnotation() {
assertGeneratedMatches(
ImmutableList.of("import javax.annotation.Resource;"),
ImmutableList.of("@Resource"),
ImmutableList.of("@Resource"));
ImmutableList.of(), ImmutableList.of("@Deprecated"), ImmutableList.of("@Deprecated"));
}

@Test
Expand Down Expand Up @@ -386,20 +384,16 @@ public void testArrayOfValuedAnnotationAnnotation() {
*/
@Test
public void testCopyingMethodAnnotations() {
ImmutableList<String> sourceImports =
ImmutableList.of("import javax.annotation.Resource;",
IMPORT_PROPERTY_ANNOTATIONS_TEST);
ImmutableList<String> sourceImports = ImmutableList.of(IMPORT_PROPERTY_ANNOTATIONS_TEST);
ImmutableList<String> sourceAnnotations =
ImmutableList.of(
"@AutoValue.CopyAnnotations(exclude={PropertyAnnotationsTest.TestAnnotation.class})",
"@Resource",
"@Deprecated",
"@PropertyAnnotationsTest.TestAnnotation",
"@PropertyAnnotationsTest.InheritedAnnotation");

ImmutableList<String> expectedAnnotations =
ImmutableList.of(
"@Resource",
"@PropertyAnnotationsTest.InheritedAnnotation");
ImmutableList.of("@Deprecated", "@PropertyAnnotationsTest.InheritedAnnotation");

JavaFileObject javaFileObject = sourceCode(sourceImports, sourceAnnotations);
JavaFileObject expectedOutput = expectedCode(sourceImports, expectedAnnotations);
Expand Down

0 comments on commit d6badd2

Please sign in to comment.