pivotal-jbarrett commented on code in PR #7551:
URL: https://github.com/apache/geode/pull/7551#discussion_r843152204


##########
geode-core/src/distributedTest/java/org/apache/geode/internal/statistics/StatisticsDistributedTest.java:
##########
@@ -544,10 +584,12 @@ public static void main(final String[] args) throws 
Exception {
       int value1 = reader.readIntStat(statType1, statName1);
       int value2 = reader.readIntStat(statType2, statName2);
 
-      assertTrue(statType1 + "#" + statName1 + "=" + value1 + " does not equal 
" + statType2 + "#"
-          + statName2 + "=" + value2, value1 == value2);
+      assertThat(value1)
+          .as(statType1 + "#" + statName1 + "=" + value1 + " does not equal " 
+ statType2 + "#"
+              + statName2 + "=" + value2)
+          .isEqualTo(value2);
     } else {
-      assertEquals("Minimum two args are required: statType statName", 2, 
args.length);
+      assertThat(args.length).as("Minimum two args are required: statType 
statName").isEqualTo(2);

Review Comment:
   Isn't there an `assertThat(args)....hasSize(2)`



##########
geode-core/src/distributedTest/java/org/apache/geode/internal/statistics/StatisticsDistributedTest.java:
##########
@@ -749,24 +791,20 @@ int readIntStat(final String typeName, final String 
statName) throws IOException
       if (dir.exists() && dir.isDirectory()) {
         List<File> archives = findFilesWithSuffix(dir, regex, ".gfs");
         return readIntStatFromArchives(archives, typeName, statName);
+      }
 
-        // one archive file
-      } else if (dir.exists() && dir.isFile()) {
-        List<File> archives = new ArrayList<>();
-        archives.add(dir);
-        return readIntStatFromArchives(archives, typeName, statName);
+      assertThat(dir.exists() && dir.isFile()).as("archive file should 
exist").isTrue();

Review Comment:
   There is a `assertThat(dir).isFile()` that satisfies both exists and is a 
file.



-- 
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]

Reply via email to