Skip to content

Commit

Permalink
Fix the containerTop test for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellix committed Sep 8, 2023
1 parent aa06671 commit ffbdf84
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,17 +666,20 @@ public void containerTop() {

ContainerTopResponse processes = containerApi.containerTop("container-top-test", null);
final String processTitle;
log.info("Process titles: " + processes.getTitles());
log.info("Processes: " + processes.getProcesses());
if (processes.getTitles().contains("CMD")) {
// Linux, macOS
processTitle = "CMD";
}
else {
} else if (processes.getTitles().contains("COMMAND")) {
// macOS
processTitle = "COMMAND";
} else {
// Windows
processTitle = "Name";
}
List<List<String>> mainProcesses = processes.getProcesses().stream().filter((p) -> p.get(processes.getTitles().indexOf(processTitle)).contains("main")).collect(Collectors.toList());
List<List<String>> mainProcesses = processes.getProcesses()
.stream()
.filter((p) -> p.get(processes.getTitles().indexOf(processTitle)).contains("main"))
.collect(Collectors.toList());

assertEquals(1, mainProcesses.size());

Expand Down

0 comments on commit ffbdf84

Please sign in to comment.