@@ -0,0 +1,2714 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more contributor license%0A * agreements. See the NOTICE file distributed with this work for additional information regarding%0A * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance with the License. You may obtain a%0A * copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software distributed under the License%0A * is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express%0A * or implied. See the License for the specific language governing permissions and limitations under%0A * the License.%0A */%0A%0Apackage org.apache.geode.management.internal.cli.result;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport org.junit.Test;%0Aimport org.junit.experimental.categories.Category;%0A%0Aimport org.apache.geode.test.junit.categories.UnitTest;%0A%0A@Category(UnitTest.class)%0Apublic class InfoResultDataTest %7B%0A%0A  @Test%0A  public void emptyInfo() %7B%0A    InfoResultData result = new InfoResultData();%0A    assertThat(result.getGfJsonObject().getString(%22content%22)).isEqualTo(%22%7B%7D%22);%0A  %7D%0A%0A  @Test%0A  public void infoWithContent() %7B%0A    InfoResultData result = new InfoResultData(%22some content%22);%0A    assertThat(result.getGfJsonObject().getJSONObject(%22content%22).getString(%22message%22))%0A        .isEqualTo(%22%5B%5C%22some content%5C%22%5D%22);%0A  %7D%0A%0A  @Test%0A  public void infoWithMultipleContentLines() %7B%0A    InfoResultData result = new InfoResultData(%22some content%22);%0A    result.addLine(%22another line of content%22);%0A    assertThat(result.getGfJsonObject().getJSONObject(%22content%22).getString(%22message%22))%0A        .isEqualTo(%22%5B%5C%22some content%5C%22,%5C%22another line of content%5C%22%5D%22);%0A  %7D%0A%0A  @Test%0A  public void infoWithFile() throws Exception %7B%0A    InfoResultData result = new InfoResultData(%22some content%22);%0A    ResultData data = result.addAsFile(%22content.zip%22, %22file contents%22, %22a message%22, false);%0A%0A    assertThat(result.getGfJsonObject().getJSONObject(%22content%22).getJSONArray(%22__bytes__%22)%0A        .getJSONObject(0).getString(%22fileName%22)).isEqualTo(%22content.zip%22);%0A    assertThat(result.getGfJsonObject().getJSONObject(%22content%22).getJSONArray(%22__bytes__%22)%0A        .getJSONObject(0).getString(%22fileType%22)).isEqualTo(%221%22);%0A    assertThat(result.getGfJsonObject().getJSONObject(%22content%22).getJSONArray(%22__bytes__%22)%0A        .getJSONObject(0).getString(%22fileMessage%22)).isEqualTo(%22a message%22);%0A    assertThat(result.getGfJsonObject().getJSONObject(%22content%22).getJSONArray(%22__bytes__%22)%0A        .getJSONObject(0).getString(%22fileData%22).length()).isGreaterThan(0);%0A  %7D%0A%7D%0A

Add unit tests for InfoResultData (#1745)