Search in sources :

Example 6 with ConfigFileType

use of com.thoughtworks.go.addon.businesscontinuity.ConfigFileType in project gocd by gocd.

the class PrimaryStatusProviderControllerTest method shouldNotIncludeFileWithEmptyMd5InLatestStatus.

@Test
void shouldNotIncludeFileWithEmptyMd5InLatestStatus() throws Exception {
    Map<ConfigFileType, String> latestStatus = new HashMap<>();
    latestStatus.put(ConfigFileType.CRUISE_CONFIG_XML, "a");
    latestStatus.put(ConfigFileType.USER_FEATURE_TOGGLE, "");
    when(goFilesStatusProvider.getLatestStatusMap()).thenReturn(latestStatus);
    primaryStatusProviderController.latestStatus(httpServletResponse);
    ServerStatusResponse serverStatusResponse = new Gson().fromJson(httpServletResponse.getContentAsString(), ServerStatusResponse.class);
    assertThat(serverStatusResponse.getFileDetailsMap().containsKey(ConfigFileType.USER_FEATURE_TOGGLE), is(false));
}
Also used : ConfigFileType(com.thoughtworks.go.addon.businesscontinuity.ConfigFileType) HashMap(java.util.HashMap) Gson(com.google.gson.Gson) ServerStatusResponse(com.thoughtworks.go.addon.businesscontinuity.primary.ServerStatusResponse) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigFileType (com.thoughtworks.go.addon.businesscontinuity.ConfigFileType)6 ServerStatusResponse (com.thoughtworks.go.addon.businesscontinuity.primary.ServerStatusResponse)4 Gson (com.google.gson.Gson)3 FileDetails (com.thoughtworks.go.addon.businesscontinuity.FileDetails)3 HashMap (java.util.HashMap)3 Test (org.junit.jupiter.api.Test)3 File (java.io.File)2 FileInputStream (java.io.FileInputStream)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1