private SimpleTest(@Named("aa") String aa, @Named("bb") String bb, @Named("cc") String cc, @Named("dd") String dd, boolean nothing) {
}
}
public void testExtractSerializedName() throws Exception {
NameExtractor<SerializedName> extractor = new ExtractSerializedName();
assertEquals(extractor.extractName(SimpleTest.class.getDeclaredField("a").getAnnotation(SerializedName.class)),
"aardvark");
try {
extractor.extractName(SimpleTest.class.getDeclaredField("b").getAnnotation(SerializedName.class));
fail();
} catch (NullPointerException e) {
}
try {
extractor.extractName(SimpleTest.class.getDeclaredField("c").getAnnotation(SerializedName.class));
fail();
} catch (NullPointerException e) {
}
try {
extractor.extractName(SimpleTest.class.getDeclaredField("d").getAnnotation(SerializedName.class));
fail();
} catch (NullPointerException e) {
}
}