slfan1989 commented on code in PR #10450:
URL: https://github.com/apache/ozone/pull/10450#discussion_r3445371576
##########
hadoop-ozone/cli-admin/src/test/java/org/apache/hadoop/hdds/scm/cli/datanode/TestDiskBalancerSubCommands.java:
##########
@@ -513,21 +513,23 @@ public void testStatusDiskBalancerWithJson() throws
Exception {
public void testStatusDiskBalancerWithMultipleNodes() throws Exception {
DiskBalancerStatusSubcommand cmd = new DiskBalancerStatusSubcommand();
- DatanodeDiskBalancerInfoProto statusProto1 =
generateRandomStatusProto("host-1");
- DatanodeDiskBalancerInfoProto statusProto2 =
generateRandomStatusProto("host-2");
+ DatanodeDiskBalancerInfoProto statusProto1 =
generateRandomStatusProto("host-2");
+ DatanodeDiskBalancerInfoProto statusProto2 =
generateRandomStatusProto("host-1");
when(mockProtocol.getDiskBalancerInfo())
.thenReturn(statusProto1, statusProto2);
try (DiskBalancerMocks mocks = setupAllMocks()) {
CommandLine c = new CommandLine(cmd);
- c.parseArgs("host-1", "host-2");
+ c.parseArgs("host-2", "host-1");
cmd.call();
String output = outContent.toString(DEFAULT_ENCODING);
- assertTrue(output.contains("host-1"));
- assertTrue(output.contains("host-2"));
+ int host2Index = output.indexOf("host-2");
+ int host1Index = output.indexOf("host-1");
+ assertTrue(host2Index >= 0);
+ assertTrue(host1Index > host2Index, output);
Review Comment:
Updated the order assertions to use AssertJ for readability, and applied the
same style to the stdin order assertion as well.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]