Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ public void test() throws Exception {
assertTrue(instance.isAmbiguous());

// use Instance<T>#select()
Greeting businessBean = instance.select(new AnnotationLiteral<Business>() {}).get();
Instance<Greeting> businessInstance = instance.select(new AnnotationLiteral<Business>() {});
Greeting businessBean = businessInstance.get();
assertThat(businessBean, instanceOf(FormalGreeting.class));
instance.destroy(businessBean);
businessInstance.destroy(businessBean);

Greeting defaultBean = instance.select(new AnnotationLiteral<Default>() {}).get();
Instance<Greeting> defaultInstance = instance.select(new AnnotationLiteral<Default>() {});
Greeting defaultBean = defaultInstance.get();
assertThat(defaultBean, instanceOf(SimpleGreeting.class));
instance.destroy(defaultBean);
defaultInstance.destroy(defaultBean);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ public void test() throws Exception {
instance.destroy(bean);

// use Instance<T>#select()
Greeting anotherBean = instance.select(new AnnotationLiteral<Default>() {}).get();
Instance<Greeting> anotherInstance = instance.select(new AnnotationLiteral<Default>() {
});
Greeting anotherBean = anotherInstance.get();
assertThat(anotherBean, instanceOf(SimpleGreeting.class));
instance.destroy(anotherBean);
anotherInstance.destroy(anotherBean);
}
}