@Test public void normalize_json_fail_on_invalid_application() { try { SystemFlagsDataArchive.normalizeJson("{\n" + " \"id\": \"foo\",\n" + " \"rules\": [\n" + " {\n" + " \"conditions\": [\n" + " {\n" + " \"type\": \"whitelist\",\n" + " \"dimension\": \"application\",\n" + " \"values\": [ \"a.b.c\" ]\n" + " }\n" + " ],\n" + " \"value\": true\n" + " }\n" + " ]\n" + "}\n"); fail(); } catch (IllegalArgumentException e) { assertEquals("Application ids must be on the form tenant:application:instance, but was a.b.c", e.getMessage()); } }
static String normalizeJson(String json) { JsonNode root = uncheck(() -> mapper.readTree(json)); removeCommentsRecursively(root); verifyValues(root); return root.toString(); }
SystemFlagsDataArchive { static String normalizeJson(String json) { JsonNode root = uncheck(() -> mapper.readTree(json)); removeCommentsRecursively(root); verifyValues(root); return root.toString(); } }
SystemFlagsDataArchive { static String normalizeJson(String json) { JsonNode root = uncheck(() -> mapper.readTree(json)); removeCommentsRecursively(root); verifyValues(root); return root.toString(); } private  SystemFlagsDataArchive(Map<FlagId, Map<String, FlagData>> files); }
SystemFlagsDataArchive { static String normalizeJson(String json) { JsonNode root = uncheck(() -> mapper.readTree(json)); removeCommentsRecursively(root); verifyValues(root); return root.toString(); } private  SystemFlagsDataArchive(Map<FlagId, Map<String, FlagData>> files); static SystemFlagsDataArchive fromZip(InputStream rawIn); static SystemFlagsDataArchive fromDirectory(Path directory); void toZip(OutputStream out); Set<FlagData> flagData(FlagsTarget target); void validateAllFilesAreForTargets(SystemName currentSystem, Set<FlagsTarget> targets); }
SystemFlagsDataArchive { static String normalizeJson(String json) { JsonNode root = uncheck(() -> mapper.readTree(json)); removeCommentsRecursively(root); verifyValues(root); return root.toString(); } private  SystemFlagsDataArchive(Map<FlagId, Map<String, FlagData>> files); static SystemFlagsDataArchive fromZip(InputStream rawIn); static SystemFlagsDataArchive fromDirectory(Path directory); void toZip(OutputStream out); Set<FlagData> flagData(FlagsTarget target); void validateAllFilesAreForTargets(SystemName currentSystem, Set<FlagsTarget> targets);  }