use of javax.lang.model.element.AnnotationValue in project auto by google.
the class AnnotationValuesTest method getInts.
@Test
public void getInts() {
AnnotationValue value = AnnotationMirrors.getAnnotationValue(annotationMirror, "intValues");
assertThat(AnnotationValues.getInts(value)).containsExactly(1, 2).inOrder();
}
use of javax.lang.model.element.AnnotationValue in project auto by google.
the class AnnotationValuesTest method getInt.
@Test
public void getInt() {
AnnotationValue value = AnnotationMirrors.getAnnotationValue(annotationMirror, "intValue");
assertThat(AnnotationValues.getInt(value)).isEqualTo(5);
}
use of javax.lang.model.element.AnnotationValue in project auto by google.
the class AnnotationValuesTest method getTypeMirror.
@Test
public void getTypeMirror() {
TypeElement insideClassA = getTypeElement(InsideClassA.class);
AnnotationValue value = AnnotationMirrors.getAnnotationValue(annotationMirror, "classValue");
assertThat(AnnotationValues.getTypeMirror(value).asElement()).isEqualTo(insideClassA);
}
use of javax.lang.model.element.AnnotationValue in project auto by google.
the class AnnotationValuesTest method getAnnotationValues.
@Test
public void getAnnotationValues() {
AnnotationValue value = AnnotationMirrors.getAnnotationValue(annotationMirror, "intValues");
ImmutableList<AnnotationValue> values = AnnotationValues.getAnnotationValues(value);
assertThat(values).comparingElementsUsing(Correspondence.transforming(AnnotationValue::getValue, "has value")).containsExactly(1, 2).inOrder();
}
use of javax.lang.model.element.AnnotationValue in project auto by google.
the class AnnotationValuesTest method getByte.
@Test
public void getByte() {
AnnotationValue value = AnnotationMirrors.getAnnotationValue(annotationMirror, "byteValue");
assertThat(AnnotationValues.getByte(value)).isEqualTo((byte) 7);
}
Aggregations