@Test
public void test_createAppRole_Failure_404() {

    String responseBody = "{\"errors\":[\"Invalid input values for AppRole creation\"]}";
    Response response =getMockResponse(HttpStatus.NOT_FOUND, true, responseBody);
    Response responseList = getMockResponse(HttpStatus.OK, true, "{\"keys\": [ \"role1\" ]}");
    Response responseAfterHide = getMockResponse(HttpStatus.OK, true, "{\"keys\": [ \"role1\" ]}");
    when(ControllerUtil.hideMasterAppRoleFromResponse(Mockito.any())).thenReturn(responseAfterHide);
    String token = "5PDrOhsy4ig8L3EpsJZSLAMg";
    String [] policies = {"default"};
    AppRole appRole = new AppRole("", policies, true, 1, 100, 0);
    String jsonStr = "{\"role_name\":\"\",\"policies\":[\"default\"],\"bind_secret_id\":true,\"secret_id_num_uses\":\"1\",\"secret_id_ttl\":\"100m\",\"token_num_uses\":0,\"token_ttl\":null,\"token_max_ttl\":null}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.NOT_FOUND).body(responseBody);
    
    when(reqProcessor.process("/auth/approle/role/create", jsonStr,token)).thenReturn(response);
    when(reqProcessor.process("/auth/approle/role/list","{}",token)).thenReturn(responseList);
    when(ControllerUtil.areAppRoleInputsValid(appRole)).thenReturn(true);
    when(JSONUtil.getJSON(appRole)).thenReturn(jsonStr);
    when(ControllerUtil.convertAppRoleInputsToLowerCase(Mockito.any())).thenReturn(jsonStr);
    UserDetails userDetails = getMockUser(true);
    ResponseEntity<String> responseEntityActual = appRoleService.createAppRole(token, appRole, userDetails);
    
    assertEquals(HttpStatus.NOT_FOUND, responseEntityActual.getStatusCode());
    assertEquals(responseEntityExpected, responseEntityActual);
}