@Test public void shouldReturnConfig() { Context<?, ?> context = new FilteringContext<>("test", new SimpleConfig(1, 2), testFilters, testBlacklist); assertEquals(new SimpleConfig(1, 2), context.config()); assertEquals(new SimpleConfig(1, 2), context.config(Config.class)); assertEquals(new SimpleConfig(1, 2), context.config(SimpleConfig.class)); }
@Test(expected = IllegalArgumentException.class) public void shouldComplainAboutWrongTypes() { Context<?, ?> context = new FilteringContext<>("test", new SimpleConfig(1, 2), testFilters, testBlacklist); context.config(KeyValueConfig.class); }