diff --git a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/inputs/formats/AggregatedPayload.java b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/inputs/formats/AggregatedPayload.java index e3297cc0b..440551fd9 100644 --- a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/inputs/formats/AggregatedPayload.java +++ b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/inputs/formats/AggregatedPayload.java @@ -114,7 +114,7 @@ private static void validate(AggregatedPayload payload) { } payload.validationErrors.add(new ErrorResponse.ErrorData(payload.getTenantId(), metricName, - source, constraintViolation.getMessage())); + source, constraintViolation.getMessage(), payload.getTimestamp())); } } @@ -158,7 +158,7 @@ public List getValidationErrors() { /** * This method is invoked by the validator automatically */ - @AssertTrue(message="Atleast one of the aggregated metrics(gauges, counters, timers, sets) are expected") + @AssertTrue(message="At least one of the aggregated metrics(gauges, counters, timers, sets) are expected") private boolean isValid() { boolean isGaugePresent = gauges != null && gauges.length > 0; boolean isCounterPresent = counters != null && counters.length > 0; diff --git a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/outputs/formats/ErrorResponse.java b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/outputs/formats/ErrorResponse.java index cd8bb8326..3e3a9f712 100644 --- a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/outputs/formats/ErrorResponse.java +++ b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/outputs/formats/ErrorResponse.java @@ -31,6 +31,7 @@ public String toString() { public static class ErrorData { private String tenantId; + private Long timestamp; private String metricName; private String source; private String message; @@ -38,17 +39,30 @@ public static class ErrorData { public ErrorData() { } - public ErrorData(String tenantId, String metricName, String source, String message) { + /*** + * Data class for storing error message for a metric from an ingest validation error + * @param tenantId the tenantId of for the metric + * @param metricName the name of the metric + * @param source the source of the error within the metric, i.e. the field with the violiation + * @param message the error message + * @param timestamp the collectionTime of a metric, timestamp of an aggregated metric, or when value of an event + */ + public ErrorData(String tenantId, String metricName, String source, String message, Long timestamp) { this.tenantId = tenantId == null ? "" : tenantId; this.metricName = metricName == null ? "" : metricName; this.source = source; this.message = message; + this.timestamp = timestamp; } public String getTenantId() { return tenantId; } + public Long getTimestamp() { + return timestamp; + } + public String getMetricName() { return metricName; } @@ -65,6 +79,10 @@ public void setTenantId(String tenantId) { this.tenantId = tenantId; } + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + public void setMetricName(String metricName) { this.metricName = metricName; } @@ -81,6 +99,7 @@ public void setMessage(String message) { public String toString() { return "ErrorData{" + "tenantId='" + tenantId + '\'' + + ", timestamp='" + timestamp + '\'' + ", metricName='" + metricName + '\'' + ", source='" + source + '\'' + ", message='" + message + '\'' + diff --git a/blueflood-http/src/integration-test/java/com/rackspacecloud/blueflood/inputs/handlers/HttpHandlerIntegrationTest.java b/blueflood-http/src/integration-test/java/com/rackspacecloud/blueflood/inputs/handlers/HttpHandlerIntegrationTest.java index d68ae82b6..47379d0e7 100644 --- a/blueflood-http/src/integration-test/java/com/rackspacecloud/blueflood/inputs/handlers/HttpHandlerIntegrationTest.java +++ b/blueflood-http/src/integration-test/java/com/rackspacecloud/blueflood/inputs/handlers/HttpHandlerIntegrationTest.java @@ -37,18 +37,18 @@ import java.io.*; import java.net.URISyntaxException; import java.util.*; -import java.util.regex.Pattern; import java.util.zip.GZIPOutputStream; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; import static org.mockito.Mockito.*; -import static org.junit.Assert.*; import static com.rackspacecloud.blueflood.TestUtils.*; public class HttpHandlerIntegrationTest extends HttpIntegrationTestBase { static private final String TENANT_ID = "acTEST"; + static private long BEFORE_CURRENT_COLLECTIONTIME_MS = Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); + static private long AFTER_CURRENT_COLLECTIONTIME_MS = Configuration.getInstance().getLongProperty( CoreConfig.AFTER_CURRENT_COLLECTIONTIME_MS ); //A time stamp 2 days ago private final long baseMillis = Calendar.getInstance().getTimeInMillis() - 172800000; @@ -85,7 +85,7 @@ public void testHttpIngestionInvalidPastCollectionTime() throws Exception { String postfix = getPostfix(); - long time = System.currentTimeMillis() - TIME_DIFF_MS - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); + long time = System.currentTimeMillis() - TIME_DIFF_MS - BEFORE_CURRENT_COLLECTIONTIME_MS; HttpResponse response = postGenMetric(TENANT_ID, postfix, postPath, time ); @@ -95,8 +95,8 @@ public void testHttpIngestionInvalidPastCollectionTime() throws Exception { assertEquals("Number of errors invalid", 3, errorResponse.getErrors().size()); for (int i = 0; i < 3; i++) { assertEquals("Invalid error source", "collectionTime", errorResponse.getErrors().get(i).getSource()); - assertEquals("Invalid error message", "Out of bounds. Cannot be more than 259200000 milliseconds into the past." + - " Cannot be more than 600000 milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); + assertEquals("Invalid error message", "Out of bounds. Cannot be more than " + BEFORE_CURRENT_COLLECTIONTIME_MS + " milliseconds into the past." + + " Cannot be more than " + AFTER_CURRENT_COLLECTIONTIME_MS + " milliseconds into the future", errorResponse.getErrors().get(i).getMessage()); } } @@ -106,7 +106,7 @@ public void testHttpIngestionInvalidFutureCollectionTime() throws Exception { String postfix = getPostfix(); - long time = System.currentTimeMillis() + TIME_DIFF_MS + Configuration.getInstance().getLongProperty( CoreConfig.AFTER_CURRENT_COLLECTIONTIME_MS ); + long time = System.currentTimeMillis() + TIME_DIFF_MS + AFTER_CURRENT_COLLECTIONTIME_MS; HttpResponse response = postGenMetric(TENANT_ID, postfix, postPath, time ); @@ -116,8 +116,8 @@ public void testHttpIngestionInvalidFutureCollectionTime() throws Exception { assertEquals("Number of errors invalid", 3, errorResponse.getErrors().size()); for (int i = 0; i < 3; i++) { assertEquals("Invalid error source", "collectionTime", errorResponse.getErrors().get(i).getSource()); - assertEquals("Invalid error message", "Out of bounds. Cannot be more than 259200000 milliseconds into the past." + - " Cannot be more than 600000 milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); + assertEquals("Invalid error message", "Out of bounds. Cannot be more than " + BEFORE_CURRENT_COLLECTIONTIME_MS + " milliseconds into the past." + + " Cannot be more than " + AFTER_CURRENT_COLLECTIONTIME_MS + " milliseconds into the future", errorResponse.getErrors().get(i).getMessage()); } } @@ -125,8 +125,8 @@ public void testHttpIngestionInvalidFutureCollectionTime() throws Exception { public void testHttpIngestionPartialInvalidCollectionTime() throws Exception { String postfix = getPostfix(); long validTime = System.currentTimeMillis(); - long pastTime = System.currentTimeMillis() - TIME_DIFF_MS - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); - long futureTime = System.currentTimeMillis() + TIME_DIFF_MS + Configuration.getInstance().getLongProperty( CoreConfig.AFTER_CURRENT_COLLECTIONTIME_MS ); + long pastTime = System.currentTimeMillis() - TIME_DIFF_MS - BEFORE_CURRENT_COLLECTIONTIME_MS; + long futureTime = System.currentTimeMillis() + TIME_DIFF_MS + AFTER_CURRENT_COLLECTIONTIME_MS; String jsonBody = getJsonFromFile("sample_multi_payload_with_different_time.json", postfix); jsonBody = updateTimeStampJson(jsonBody, "\"%TIMESTAMP_1%\"", validTime); @@ -139,7 +139,11 @@ public void testHttpIngestionPartialInvalidCollectionTime() throws Exception { try { assertEquals("Should get status 207 from " + String.format(postMultiPath, TENANT_ID), 207, response.getStatusLine().getStatusCode() ); - assertTrue("", errorResponse.getErrors().size() > 0); + for (int i = 0; i < 4; i++) { + assertEquals("Invalid error source", "collectionTime", errorResponse.getErrors().get(i).getSource()); + assertEquals("Invalid error message", "Out of bounds. Cannot be more than " + BEFORE_CURRENT_COLLECTIONTIME_MS + " milliseconds into the past." + + " Cannot be more than " + AFTER_CURRENT_COLLECTIONTIME_MS + " milliseconds into the future", errorResponse.getErrors().get(i).getMessage()); + } } finally { EntityUtils.consume( response.getEntity() ); // Releases connection apparently @@ -149,8 +153,7 @@ public void testHttpIngestionPartialInvalidCollectionTime() throws Exception { @Test public void testHttpAggregatedIngestionInvalidPastCollectionTime() throws IOException, URISyntaxException { - long timestamp = System.currentTimeMillis() - TIME_DIFF_MS - - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); + long timestamp = System.currentTimeMillis() - TIME_DIFF_MS - BEFORE_CURRENT_COLLECTIONTIME_MS; HttpResponse response = postMetric("333333", postAggregatedPath, "sample_payload.json", timestamp, getPostfix()); ErrorResponse errorResponse = getErrorResponse(response); @@ -158,15 +161,14 @@ public void testHttpAggregatedIngestionInvalidPastCollectionTime() throws IOExce assertEquals(400, response.getStatusLine().getStatusCode()); assertEquals("Number of errors invalid", 1, errorResponse.getErrors().size()); assertEquals("Invalid error source", "timestamp", errorResponse.getErrors().get(0).getSource()); - assertEquals("Invalid error message", "Out of bounds. Cannot be more than 259200000 milliseconds into the past." + - " Cannot be more than 600000 milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); + assertEquals("Invalid error message", "Out of bounds. Cannot be more than " + BEFORE_CURRENT_COLLECTIONTIME_MS + " milliseconds into the past." + + " Cannot be more than " + AFTER_CURRENT_COLLECTIONTIME_MS + " milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); } @Test public void testHttpAggregatedIngestionInvalidFutureCollectionTime() throws IOException, URISyntaxException { - long timestamp = System.currentTimeMillis() + TIME_DIFF_MS - + Configuration.getInstance().getLongProperty( CoreConfig.AFTER_CURRENT_COLLECTIONTIME_MS ); + long timestamp = System.currentTimeMillis() + TIME_DIFF_MS + AFTER_CURRENT_COLLECTIONTIME_MS; HttpResponse response = postMetric("333333", postAggregatedPath, "sample_payload.json", timestamp, getPostfix()); ErrorResponse errorResponse = getErrorResponse(response); @@ -174,8 +176,8 @@ public void testHttpAggregatedIngestionInvalidFutureCollectionTime() throws IOEx assertEquals(400, response.getStatusLine().getStatusCode()); assertEquals("Number of errors invalid", 1, errorResponse.getErrors().size()); assertEquals("Invalid error source", "timestamp", errorResponse.getErrors().get(0).getSource()); - assertEquals("Invalid error message", "Out of bounds. Cannot be more than 259200000 milliseconds into the past." + - " Cannot be more than 600000 milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); + assertEquals("Invalid error message", "Out of bounds. Cannot be more than " + BEFORE_CURRENT_COLLECTIONTIME_MS + " milliseconds into the past." + + " Cannot be more than " + AFTER_CURRENT_COLLECTIONTIME_MS + " milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); } @Test @@ -207,8 +209,7 @@ locator, RollupType.COUNTER, new Range( start, end ), @Test public void testHttpAggregatedMultiIngestionInvalidPastCollectionTime() throws IOException, URISyntaxException { - long timestamp = System.currentTimeMillis() - TIME_DIFF_MS - - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); + long timestamp = System.currentTimeMillis() - TIME_DIFF_MS - BEFORE_CURRENT_COLLECTIONTIME_MS; String postfix = getPostfix(); @@ -222,16 +223,15 @@ public void testHttpAggregatedMultiIngestionInvalidPastCollectionTime() throws I assertEquals("Number of errors invalid", 3, errorResponse.getErrors().size()); assertEquals("Invalid error source", "timestamp", errorResponse.getErrors().get(0).getSource()); - assertEquals("Invalid error message", "Out of bounds. Cannot be more than 259200000 milliseconds into the past." + - " Cannot be more than 600000 milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); + assertEquals("Invalid error message", "Out of bounds. Cannot be more than " + BEFORE_CURRENT_COLLECTIONTIME_MS + " milliseconds into the past." + + " Cannot be more than " + AFTER_CURRENT_COLLECTIONTIME_MS + " milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); } @Test public void testHttpAggregatedMultiIngestionInvalidFutureCollectionTime() throws IOException, URISyntaxException { - long timestamp = System.currentTimeMillis() + TIME_DIFF_MS - + Configuration.getInstance().getLongProperty( CoreConfig.AFTER_CURRENT_COLLECTIONTIME_MS ); + long timestamp = System.currentTimeMillis() + TIME_DIFF_MS + AFTER_CURRENT_COLLECTIONTIME_MS; String postfix = getPostfix(); @@ -245,8 +245,8 @@ public void testHttpAggregatedMultiIngestionInvalidFutureCollectionTime() throws assertEquals("Number of errors invalid", 3, errorResponse.getErrors().size()); assertEquals("Invalid error source", "timestamp", errorResponse.getErrors().get(0).getSource()); - assertEquals("Invalid error message", "Out of bounds. Cannot be more than 259200000 milliseconds into the past." + - " Cannot be more than 600000 milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); + assertEquals("Invalid error message", "Out of bounds. Cannot be more than " + BEFORE_CURRENT_COLLECTIONTIME_MS + " milliseconds into the past." + + " Cannot be more than " + AFTER_CURRENT_COLLECTIONTIME_MS + " milliseconds into the future", errorResponse.getErrors().get(0).getMessage()); } @Test @@ -292,8 +292,8 @@ locator2, RollupType.ENUM, new Range(start, end), public void testHttpAggregatedMultiPartialInvalidCollectionTime() throws Exception { String postfix = getPostfix(); long validTime = System.currentTimeMillis(); - long pastTime = System.currentTimeMillis() - TIME_DIFF_MS - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); - long futureTime = System.currentTimeMillis() + TIME_DIFF_MS + Configuration.getInstance().getLongProperty( CoreConfig.AFTER_CURRENT_COLLECTIONTIME_MS ); + long pastTime = System.currentTimeMillis() - TIME_DIFF_MS - BEFORE_CURRENT_COLLECTIONTIME_MS; + long futureTime = System.currentTimeMillis() + TIME_DIFF_MS + AFTER_CURRENT_COLLECTIONTIME_MS; String jsonBody = getJsonFromFile("sample_multi_aggregated_payload_with_different_time.json", postfix); jsonBody = updateTimeStampJson(jsonBody, "\"%TIMESTAMP_1%\"", validTime); @@ -302,11 +302,15 @@ public void testHttpAggregatedMultiPartialInvalidCollectionTime() throws Excepti jsonBody = jsonBody.replaceAll("%TENANT_ID_.%", TENANT_ID); HttpResponse response = httpPost(TENANT_ID, postAggregatedMultiPath, jsonBody ); - String[] output = getBodyArray(response); + ErrorResponse errorResponse = getErrorResponse(response); try { assertEquals("Should get status 207 from " + String.format(postAggregatedMultiPath, TENANT_ID), 207, response.getStatusLine().getStatusCode() ); - assertEquals("", output[0]); + for (int i = 0; i < 2; i++) { + assertEquals("Invalid error source", "timestamp", errorResponse.getErrors().get(i).getSource()); + assertEquals("Invalid error message", "Out of bounds. Cannot be more than " + BEFORE_CURRENT_COLLECTIONTIME_MS + " milliseconds into the past." + + " Cannot be more than " + AFTER_CURRENT_COLLECTIONTIME_MS + " milliseconds into the future", errorResponse.getErrors().get(i).getMessage()); + } } finally { EntityUtils.consume( response.getEntity() ); // Releases connection apparently @@ -472,7 +476,10 @@ public void testMultiTenantPartialFailureWithoutTenant() throws Exception { try { assertEquals("Should get status 207 from " + String.format(postMultiPath, TENANT_ID), 207, response.getStatusLine().getStatusCode()); - assertTrue("No errors found", errorResponse.getErrors().size() > 0); + for (int i = 0; i < 2; i++) { + assertEquals("Invalid error source", "tenantId", errorResponse.getErrors().get(i).getSource()); + assertEquals("Invalid error message", "may not be empty", errorResponse.getErrors().get(i).getMessage()); + } } finally { EntityUtils.consume( response.getEntity() ); // Releases connection apparently diff --git a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/http/DefaultHandler.java b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/http/DefaultHandler.java index e1d9833c8..301ed7409 100644 --- a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/http/DefaultHandler.java +++ b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/http/DefaultHandler.java @@ -65,7 +65,7 @@ public static void sendErrorResponse(ChannelHandlerContext ctx, FullHttpRequest final String tenantId = request.headers().get("tenantId"); List errrors = new ArrayList(){{ - add(new ErrorResponse.ErrorData(tenantId, null, null, message)); + add(new ErrorResponse.ErrorData(tenantId, null, null, message, null)); }}; sendErrorResponse(ctx, request, errrors, status); diff --git a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpAggregatedMultiIngestionHandler.java b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpAggregatedMultiIngestionHandler.java index 478b4fbec..a56a8c0bc 100644 --- a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpAggregatedMultiIngestionHandler.java +++ b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpAggregatedMultiIngestionHandler.java @@ -128,7 +128,7 @@ public void handle(ChannelHandlerContext ctx, FullHttpRequest request) { return; } else { // has some validation errors, response MULTI_STATUS - DefaultHandler.sendResponse(ctx, request, null, HttpResponseStatus.MULTI_STATUS); + DefaultHandler.sendErrorResponse(ctx, request, errors, HttpResponseStatus.MULTI_STATUS); return; } diff --git a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpEventsIngestionHandler.java b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpEventsIngestionHandler.java index 0c4219722..4c458adba 100644 --- a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpEventsIngestionHandler.java +++ b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpEventsIngestionHandler.java @@ -82,8 +82,10 @@ public void handle(ChannelHandlerContext ctx, FullHttpRequest request) { List validationErrors = new ArrayList(); for (ConstraintViolation constraintViolation : constraintViolations) { - validationErrors.add(new ErrorResponse.ErrorData(tenantId, "", - constraintViolation.getPropertyPath().toString(), constraintViolation.getMessage())); + validationErrors.add( + new ErrorResponse.ErrorData(tenantId, "", + constraintViolation.getPropertyPath().toString(), constraintViolation.getMessage(), + event.getWhen())); } if (!validationErrors.isEmpty()) { diff --git a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMetricsIngestionHandler.java b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMetricsIngestionHandler.java index 070573755..d5762b75a 100644 --- a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMetricsIngestionHandler.java +++ b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMetricsIngestionHandler.java @@ -111,7 +111,8 @@ protected JSONMetricsContainer createContainer(String body, String tenantId) thr } else { for (ConstraintViolation constraintViolation : constraintViolations) { validationErrors.add(new ErrorResponse.ErrorData(tenantId, metric.getMetricName(), - constraintViolation.getPropertyPath().toString(), constraintViolation.getMessage())); + constraintViolation.getPropertyPath().toString(), constraintViolation.getMessage(), + metric.getCollectionTime())); } } } diff --git a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMultitenantMetricsIngestionHandler.java b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMultitenantMetricsIngestionHandler.java index 27a624e24..09976c779 100644 --- a/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMultitenantMetricsIngestionHandler.java +++ b/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMultitenantMetricsIngestionHandler.java @@ -55,8 +55,10 @@ protected JSONMetricsContainer createContainer(String body, String tenantId) thr validJsonMetrics.add(metric); } else { for (ConstraintViolation constraintViolation : constraintViolations) { - validationErrors.add(new ErrorResponse.ErrorData(scopedMetric.getTenantId(), metric.getMetricName(), - constraintViolation.getPropertyPath().toString(), constraintViolation.getMessage())); + validationErrors.add( + new ErrorResponse.ErrorData(scopedMetric.getTenantId(), metric.getMetricName(), + constraintViolation.getPropertyPath().toString(), constraintViolation.getMessage(), + metric.getCollectionTime())); } } } diff --git a/blueflood-http/src/test/java/com/rackspacecloud/blueflood/inputs/handlers/HttpAggregatedIngestionHandlerTest.java b/blueflood-http/src/test/java/com/rackspacecloud/blueflood/inputs/handlers/HttpAggregatedIngestionHandlerTest.java index ec25d0e80..3309f1f22 100644 --- a/blueflood-http/src/test/java/com/rackspacecloud/blueflood/inputs/handlers/HttpAggregatedIngestionHandlerTest.java +++ b/blueflood-http/src/test/java/com/rackspacecloud/blueflood/inputs/handlers/HttpAggregatedIngestionHandlerTest.java @@ -296,7 +296,7 @@ public void testAggregatedMetricsNotSet() throws IOException { ErrorResponse errorResponse = getErrorResponse(errorResponseBody); assertEquals("Number of errors invalid", 1, errorResponse.getErrors().size()); - assertEquals("Invalid error message", "Atleast one of the aggregated metrics(gauges, counters, timers, sets) " + + assertEquals("Invalid error message", "At least one of the aggregated metrics(gauges, counters, timers, sets) " + "are expected", errorResponse.getErrors().get(0).getMessage()); assertEquals("Invalid source", "", errorResponse.getErrors().get(0).getSource()); assertEquals("Invalid tenant", TENANT, errorResponse.getErrors().get(0).getTenantId());