dan-s1 commented on code in PR #6823:
URL: https://github.com/apache/nifi/pull/6823#discussion_r1063479870
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/status/analytics/TestConnectionStatusAnalytics.java:
##########
@@ -383,48 +360,48 @@ public void testGetNextIntervalPercentageUseBytes() {
ConnectionStatusAnalytics connectionStatusAnalytics =
getConnectionStatusAnalytics(modelMap);
Long percentage =
connectionStatusAnalytics.getNextIntervalPercentageUseBytes(connection,
flowFileEvent);
assertNotNull(percentage);
- assert (percentage == 10);
+ assertEquals(10, percentage);
}
@Test
public void testGetScores() {
Date now = new Date();
- Long tomorrowMillis =
DateUtils.addDays(now,1).toInstant().toEpochMilli();
- Map<String, Tuple<StatusAnalyticsModel, StatusMetricExtractFunction>>
bytesModelMap =
getModelMap("queuedBytes",.9,10000000.0,tomorrowMillis.doubleValue());
- Map<String, Tuple<StatusAnalyticsModel, StatusMetricExtractFunction>>
countModelMap = getModelMap("queuedCount",.9,50.0,tomorrowMillis.doubleValue());
+ long tomorrowMillis =
DateUtils.addDays(now,1).toInstant().toEpochMilli();
+ Map<String, Tuple<StatusAnalyticsModel, StatusMetricExtractFunction>>
bytesModelMap = getModelMap("queuedBytes",.9,10000000.0, (double)
tomorrowMillis);
+ Map<String, Tuple<StatusAnalyticsModel, StatusMetricExtractFunction>>
countModelMap = getModelMap("queuedCount",.9,50.0, (double) tomorrowMillis);
countModelMap.putAll(bytesModelMap);
ConnectionStatusAnalytics connectionStatusAnalytics =
getConnectionStatusAnalytics(countModelMap);
connectionStatusAnalytics.loadPredictions(repositoryStatusReport);
Map<String,Long> scores = connectionStatusAnalytics.getPredictions();
assertNotNull(scores);
assertFalse(scores.isEmpty());
- assertTrue(scores.get("nextIntervalPercentageUseCount").equals(50L));
- assertTrue(scores.get("nextIntervalBytes").equals(10000000L));
+ assertEquals(50L, (long) scores.get("nextIntervalPercentageUseCount"));
+ assertEquals(10000000L, (long) scores.get("nextIntervalBytes"));
Review Comment:
Casts are not necessary as it is coming from a Map whose values are of type
Long.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]