This commit is contained in:
Anders Båtstrand
2017-01-04 10:50:41 +01:00
parent 1762a6a59f
commit 69192f6f67
2 changed files with 9 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
@@ -37,6 +38,8 @@ public class NamedContextFactoryTests {
Bar bar = factory.getInstance("bar", Bar.class);
assertThat("bar was null", bar, is(notNullValue()));
assertThat("context names not exposed", factory.getContextNames(), hasItems("foo", "bar"));
Bar foobar = factory.getInstance("foo", Bar.class);
assertThat("bar was not null", foobar, is(nullValue()));