@Test
public void testSimpleLevelOverriding() throws Exception {

  String apiConfigSource = g.generateConfig(SimpleLevelOverridingApi.class).get("myapi-v1.api");
  JsonNode root = objectMapper.readValue(apiConfigSource, JsonNode.class);
  JsonNode methods = root.path("methods");
  // myapi.resource1.noOverrides
  JsonNode noOverrides = methods.path("myapi.resource1.noOverrides");
  assertFalse(noOverrides.isMissingNode());
  verifyStrings(objectMapper.convertValue(noOverrides.path("scopes"), String[].class),
      new String[] {"s0a", "s1a"});
  verifyStrings(objectMapper.convertValue(noOverrides.path("audiences"), String[].class),
      new String[] {"a0a", "a1a"});
  verifyStrings(objectMapper.convertValue(noOverrides.path("clientIds"), String[].class),
      new String[] {"c0a", "c1a"});
  assertEquals("resource1", objectMapper.convertValue(noOverrides.path("path"), String.class));
  assertEquals(AuthLevel.REQUIRED,
      objectMapper.convertValue(noOverrides.path("authLevel"), AuthLevel.class));
  // myapi.resource1.overrides
  JsonNode overrides = methods.path("myapi.resource1.overrides");
  assertFalse(overrides.isMissingNode());
  verifyStrings(objectMapper.convertValue(overrides.path("scopes"), String[].class),
      new String[] {"s0b", "s1b"});
  verifyStrings(objectMapper.convertValue(overrides.path("audiences"), String[].class),
      new String[] {"a0b", "a1b"});
  verifyStrings(objectMapper.convertValue(overrides.path("clientIds"), String[].class),
      new String[] {"c0b", "c1b"});
  assertEquals("overridden", objectMapper.convertValue(overrides.path("path"), String.class));
  assertEquals(AuthLevel.OPTIONAL,
      objectMapper.convertValue(overrides.path("authLevel"), AuthLevel.class));
}