Ejemplo n.º 1
0
  @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));
  }
Ejemplo n.º 2
0
  @Test(expected = IllegalArgumentException.class)
  public void shouldComplainAboutWrongTypes() {
    Context<?, ?> context =
        new FilteringContext<>("test", new SimpleConfig(1, 2), testFilters, testBlacklist);

    context.config(KeyValueConfig.class);
  }