@Test
public void getOrAdd_mapType() throws Exception {

  //unsupported map types still use JsonMap schema
  checkJsonMap("getStringArrayMap");
  //non-string key values generate an exception
  try {
    checkJsonMap("getArrayStringMap");
    fail("Should have failed to generate map schema");
  } catch (IllegalArgumentException e) {
    //expected exception
  }
  //supported map types generate proper map schema
  ApiMethodConfig methodConfig = getMethodConfig("getStringEnumMap");
  Schema schema = repo.getOrAdd(methodConfig.getReturnType(), config);
  assertThat(schema).isEqualTo(Schema.builder()
      .setName("Map_String_TestEnum")
      .setType("object")
      .setMapValueSchema(Field.builder()
          .setName(SchemaRepository.MAP_UNUSED_MSG)
          .setType(FieldType.ENUM)
          .setSchemaReference(SchemaReference.create(repo, config,
              TypeToken.of(TestEnum.class)))
          .build())
      .build());
}