From f7323ffa2b8c6da0a9d060ac2e657a04128f121a Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 5 Apr 2016 13:58:53 +0200 Subject: [PATCH] Fix ProcessStateSystemInfoTest on Java 8 --- .../process/systeminfo/ProcessStateSystemInfoTest.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server/sonar-process/src/test/java/org/sonar/process/systeminfo/ProcessStateSystemInfoTest.java b/server/sonar-process/src/test/java/org/sonar/process/systeminfo/ProcessStateSystemInfoTest.java index b1088a07584..8369c88c8d1 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/systeminfo/ProcessStateSystemInfoTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/systeminfo/ProcessStateSystemInfoTest.java @@ -38,11 +38,8 @@ public class ProcessStateSystemInfoTest { ProtobufSystemInfo.Section section = underTest.toProtobuf(); assertThat(section.getName()).isEqualTo(PROCESS_NAME); - assertThat(section.getAttributesCount()).isEqualTo(9); - assertThat(section.getAttributes(0).getKey()).isEqualTo("Heap Committed (MB)"); - assertThat(section.getAttributes(0).getLongValue()).isGreaterThan(1L); - assertThat(section.getAttributes(8).getKey()).isEqualTo("Thread Count"); - assertThat(section.getAttributes(8).getLongValue()).isGreaterThan(1L); + assertThat(section.getAttributesCount()).isGreaterThan(0); + assertThat(section.getAttributesList()).extracting("key").contains("Thread Count"); } @Test -- 2.39.5