test_class.file: dubbo-common/src/test/java/org/apache/dubbo/common/status/support/StatusUtilsTest.java
test_class.identifier: StatusUtilsTest
test_case.body: @Test
      public void testGetSummaryStatus1() throws Exception {
          Status status1 = new Status(Status.Level.ERROR);
          Status status2 = new Status(Status.Level.WARN);
          Status status3 = new Status(Status.Level.OK);
          Map<String, Status> statuses = new HashMap<String, Status>();
          statuses.put("status1", status1);
          statuses.put("status2", status2);
          statuses.put("status3", status3);
          Status status = StatusUtils.getSummaryStatus(statuses);
          assertThat(status.getLevel(), is(Status.Level.ERROR));
          assertThat(status.getMessage(), containsString("status1"));
          assertThat(status.getMessage(), containsString("status2"));
          assertThat(status.getMessage(), not(containsString("status3")));
      }
test_case.class_method_signature: StatusUtilsTest.testGetSummaryStatus1()
test_case.full_signature: @Test public void testGetSummaryStatus1()
test_case.identifier: testGetSummaryStatus1
test_case.invocations: put put put getSummaryStatus assertThat getLevel is assertThat getMessage containsString assertThat getMessage containsString assertThat getMessage not containsString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetSummaryStatus1()
focal_class.file: dubbo-common/src/main/java/org/apache/dubbo/common/status/support/StatusUtils.java
focal_class.identifier: StatusUtils
focal_class.class_method_signature: StatusUtils.getSummaryStatus(Map<String, Status> statuses)
focal_class.full_signature: public static Status getSummaryStatus(Map<String, Status> statuses)
focal_class.identifier: getSummaryStatus
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Status> statuses)
focal_class.return: Status
focal_class.signature: Status getSummaryStatus(Map<String, Status> statuses)
focal_method.body: public static Status getSummaryStatus(Map<String, Status> statuses) {
          Level level = Level.OK;
          StringBuilder msg = new StringBuilder();
          for (Map.Entry<String, Status> entry : statuses.entrySet()) {
              String key = entry.getKey();
              Status status = entry.getValue();
              Level l = status.getLevel();
              if (Level.ERROR.equals(l)) {
                  level = Level.ERROR;
                  if (msg.length() > 0) {
                      msg.append(",");
                  }
                  msg.append(key);
              } else if (Level.WARN.equals(l)) {
                  if (!Level.ERROR.equals(level)) {
                      level = Level.WARN;
                  }
                  if (msg.length() > 0) {
                      msg.append(",");
                  }
                  msg.append(key);
              }
          }
          return new Status(level, msg.toString());
      }
focal_method.class_method_signature: StatusUtils.getSummaryStatus(Map<String, Status> statuses)
focal_method.full_signature: public static Status getSummaryStatus(Map<String, Status> statuses)
focal_method.identifier: getSummaryStatus
focal_method.invocations: entrySet getKey getValue getLevel equals length append append equals equals length append append toString
focal_method.modifiers: public static
focal_method.parameters: (Map<String, Status> statuses)
focal_method.return: Status
focal_method.signature: Status getSummaryStatus(Map<String, Status> statuses)