MCPcopy Index your code
hub / github.com/google/guice / testWithAnnotationInstance

Method testWithAnnotationInstance

core/test/com/google/inject/KeyTest.java:68–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 }
67
68 public void testWithAnnotationInstance() throws NoSuchFieldException {
69 Foo annotation = getClass().getDeclaredField("baz").getAnnotation(Foo.class);
70 Key<Object> k = Key.get(Object.class);
71 Key<Object> kf = k.withAnnotation(annotation);
72 assertNull(k.getAnnotationType());
73 assertNull(k.getAnnotation());
74 assertEquals(Foo.class, kf.getAnnotationType());
75 assertEquals(annotation, kf.getAnnotation());
76 }
77
78 public void testKeyEquality() {
79 Key<List<String>> a = new Key<List<String>>(Foo.class) {};

Callers

nothing calls this directly

Calls 4

getMethod · 0.95
withAnnotationMethod · 0.80
getAnnotationMethod · 0.65
getAnnotationTypeMethod · 0.65

Tested by

no test coverage detected