@Test public void json_example_validated() throws Exception { insertNewMetricDto(newEnabledMetric("API Compatibility")); insertNewMetricDto(newEnabledMetric("Issues")); insertNewMetricDto(newEnabledMetric("Rules")); insertNewMetricDto(newEnabledMetric("Tests")); insertNewMetricDto(newEnabledMetric("Documentation")); insertNewMetricDto(newEnabledMetric(null)); insertNewMetricDto(newEnabledMetric("")); insertNewMetricDto(newMetricDto().setDomain("Domain of Deactivated Metric").setEnabled(false)); WsTester.Result result = ws.newGetRequest(MetricsWs.ENDPOINT, "domains").execute(); JsonAssert.assertJson(result.outputAsString()) .isSimilarTo(getClass().getResource("example-domains.json")); }