### Question:
MetadataDiscoveryResource extends AbstractMetadataResource { @GET @Path("/{name}/replication-metrics/list") @Produces({MediaType.APPLICATION_JSON}) public Response listReplicationMetricsDimensionValues(@PathParam("name") final String schedEntityName, @QueryParam("type") final String schedEntityType, @QueryParam("numResults") Integer numResults) { JSONArray dimensionValues = new JSONArray(); int resultsPerQuery = numResults == null ? 10 : numResults; if (StringUtils.isNotBlank(schedEntityName)) { try { EntityUtil.getEntity(schedEntityType, schedEntityName); } catch (Throwable e) { throw FalconWebException.newAPIException(e, Response.Status.BAD_REQUEST); } dimensionValues = getReplicationEntityDimensionValues(schedEntityName, resultsPerQuery); } try { JSONObject response = new JSONObject(); response.put(RESULTS, dimensionValues); response.put(TOTAL_SIZE, dimensionValues.length()); return Response.ok(response).build(); } catch (JSONException e) { throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } }  @GET @Path("/{type}/list") @Produces({MediaType.APPLICATION_JSON}) Response listDimensionValues(@PathParam("type") String dimensionType,
                                        @QueryParam("cluster") final String clusterName); @GET @Path("/{name}/replication-metrics/list") @Produces({MediaType.APPLICATION_JSON}) Response listReplicationMetricsDimensionValues(@PathParam("name") final String schedEntityName,
                                                          @QueryParam("type") final String schedEntityType,
                                                          @QueryParam("numResults") Integer numResults); JSONArray getReplicationEntityDimensionValues(final String schedEntityName,
                                            final int resultsPerQuery); @GET @Path("/{type}/{name}/relations") @Produces({MediaType.APPLICATION_JSON}) Response getDimensionRelations(@PathParam("type") String dimensionType,
                                          @PathParam("name") String dimensionName);  }### Answer:
@Test public void testListDimensionsMetrics() throws Exception { MetadataDiscoveryResource resource = new MetadataDiscoveryResource(); Response response = resource.listReplicationMetricsDimensionValues("sample-process", EntityType.PROCESS.name(), 5); Map results = (Map) JSONValue.parse(response.getEntity().toString()); Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); List metrics = (List) results.get(MetadataDiscoveryResource.RESULTS); Assert.assertEquals(metrics.size(), 1); Assert.assertTrue(metrics.get(0).toString().contains("BYTESCOPIED")); Assert.assertTrue(metrics.get(0).toString().contains("COPY")); }