@Test
    public void validateUITemplate() throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        mapper.enable(JsonParser.Feature.ALLOW_COMMENTS);
        Set<String> dashboardIds = new HashSet<>();
        Set<String> dashboardNames = new HashSet<>();
        for (String folder : UITemplateInitializer.UI_TEMPLATE_FOLDER) {
            File[] templateFiles = ResourceUtils.getPathFiles("ui-initialized-templates/" + folder.toLowerCase(
                Locale.ROOT));
            for (File template : templateFiles) {
                JsonNode jsonNode;
                try {
                    jsonNode = mapper.readTree(template);
                } catch (Exception e) {
                    throw new IllegalArgumentException("File: " + template.getName() + " is not a legal json file.", e);
                }
                if (jsonNode == null || jsonNode.isEmpty()) {
                    continue;
                }
                if (jsonNode.size() > 1) {
                    throw new IllegalArgumentException(
                        "File:  " + template.getName() + " should be only one dashboard setting json object.");
                }

                JsonNode configNode = jsonNode.get(0).get("configuration");
                String inId = jsonNode.get(0).get("id").textValue();
                String inName = configNode.get("name").textValue();
                String inLayer = configNode.get("layer").textValue();
                String inEntity = configNode.get("entity").textValue();
                Assertions.assertFalse(dashboardIds.contains(inId), "File: " + template + " has duplicate id: " + inId);
                dashboardIds.add(inId);
                String nameKey = StringUtil.join('_', inLayer, inEntity, inName);
                Assertions.assertFalse(dashboardNames.contains(nameKey), "File:" + template + " has duplicate name: " + inName);
                dashboardNames.add(nameKey);

                //Todo: implement more validation.
            }
        }
    }
@since 9.0.0 SkyWalking migrate to skywalking-booster-ui, the configs are changed. This test verifies whether the
config files are legal, otherwise would fail, in order to block the merge.
oap-server/server-starter/src/test/java/org/apache/skywalking/oap/server/starter/UITemplateCheckerTest.java