@Test public void test_getIdentityGroupDetails_failed() throws Exception { String group = "group1"; String token = "test4ig8L3EpsJZSLAMg"; when(OIDCUtil.getIdentityGroupDetails(group, token)).thenReturn(null); ResponseEntity<String> expectedResponseEntity = ResponseEntity.status(HttpStatus.NOT_FOUND).body("{\"errors\":[\"Group not found\"]}"); ResponseEntity<String> actualResponse = oidcAuthService.getIdentityGroupDetails(group, token); assertEquals(expectedResponseEntity.getStatusCode(), actualResponse.getStatusCode()); assertEquals(expectedResponseEntity.getBody(), actualResponse.getBody()); }
public ResponseEntity<String> getIdentityGroupDetails(String groupName, String token) { OIDCGroup oidcGroup = oidcUtil.getIdentityGroupDetails(groupName, token); if (oidcGroup != null) { return ResponseEntity.status(HttpStatus.OK).body(JSONUtil.getJSON(oidcGroup)); } else { return ResponseEntity.status(HttpStatus.NOT_FOUND).body("{\"errors\":[\"Group not found\"]}"); } }
OIDCAuthService { public ResponseEntity<String> getIdentityGroupDetails(String groupName, String token) { OIDCGroup oidcGroup = oidcUtil.getIdentityGroupDetails(groupName, token); if (oidcGroup != null) { return ResponseEntity.status(HttpStatus.OK).body(JSONUtil.getJSON(oidcGroup)); } else { return ResponseEntity.status(HttpStatus.NOT_FOUND).body("{\"errors\":[\"Group not found\"]}"); } } }
OIDCAuthService { public ResponseEntity<String> getIdentityGroupDetails(String groupName, String token) { OIDCGroup oidcGroup = oidcUtil.getIdentityGroupDetails(groupName, token); if (oidcGroup != null) { return ResponseEntity.status(HttpStatus.OK).body(JSONUtil.getJSON(oidcGroup)); } else { return ResponseEntity.status(HttpStatus.NOT_FOUND).body("{\"errors\":[\"Group not found\"]}"); } }  }
OIDCAuthService { public ResponseEntity<String> getIdentityGroupDetails(String groupName, String token) { OIDCGroup oidcGroup = oidcUtil.getIdentityGroupDetails(groupName, token); if (oidcGroup != null) { return ResponseEntity.status(HttpStatus.OK).body(JSONUtil.getJSON(oidcGroup)); } else { return ResponseEntity.status(HttpStatus.NOT_FOUND).body("{\"errors\":[\"Group not found\"]}"); } }  ResponseEntity<String> getAuthenticationMounts(String token); ResponseEntity<OIDCEntityResponse> entityLookUp(String token,
			OIDCLookupEntityRequest oidcLookupEntityRequest); ResponseEntity<String> groupEntityLookUp(String token, OIDCLookupEntityRequest oidcLookupEntityRequest); ResponseEntity<String> readEntityAliasById(String token, String id); ResponseEntity<String> readEntityByName(String token, String entityName); ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest); ResponseEntity<String> updateIdentityGroupByName(String token,
                                                            OIDCIdentityGroupRequest oidcIdentityGroupRequest); ResponseEntity<String> readGroupAliasById(String token, String id); ResponseEntity<String> deleteGroupByName(String token, String name); ResponseEntity<String> deleteGroupAliasByID(String token, String id); ResponseEntity<String> createGroupAlias(String token, GroupAliasRequest groupAliasRequest); ResponseEntity<String> getAuthUrl(OidcRequest oidcRequest); ResponseEntity<String> processOIDCCallback(String state, String code); ResponseEntity<String> getGroupObjectIdFromAzure(String groupName); ResponseEntity<String> getIdentityGroupDetails(String groupName, String token); ResponseEntity<String> getUserName(UserDetails userDetails); ResponseEntity<DirectoryObjects> searchGroupInAzureAD(String groupName); }
OIDCAuthService { public ResponseEntity<String> getIdentityGroupDetails(String groupName, String token) { OIDCGroup oidcGroup = oidcUtil.getIdentityGroupDetails(groupName, token); if (oidcGroup != null) { return ResponseEntity.status(HttpStatus.OK).body(JSONUtil.getJSON(oidcGroup)); } else { return ResponseEntity.status(HttpStatus.NOT_FOUND).body("{\"errors\":[\"Group not found\"]}"); } }  ResponseEntity<String> getAuthenticationMounts(String token); ResponseEntity<OIDCEntityResponse> entityLookUp(String token,
			OIDCLookupEntityRequest oidcLookupEntityRequest); ResponseEntity<String> groupEntityLookUp(String token, OIDCLookupEntityRequest oidcLookupEntityRequest); ResponseEntity<String> readEntityAliasById(String token, String id); ResponseEntity<String> readEntityByName(String token, String entityName); ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest); ResponseEntity<String> updateIdentityGroupByName(String token,
                                                            OIDCIdentityGroupRequest oidcIdentityGroupRequest); ResponseEntity<String> readGroupAliasById(String token, String id); ResponseEntity<String> deleteGroupByName(String token, String name); ResponseEntity<String> deleteGroupAliasByID(String token, String id); ResponseEntity<String> createGroupAlias(String token, GroupAliasRequest groupAliasRequest); ResponseEntity<String> getAuthUrl(OidcRequest oidcRequest); ResponseEntity<String> processOIDCCallback(String state, String code); ResponseEntity<String> getGroupObjectIdFromAzure(String groupName); ResponseEntity<String> getIdentityGroupDetails(String groupName, String token); ResponseEntity<String> getUserName(UserDetails userDetails); ResponseEntity<DirectoryObjects> searchGroupInAzureAD(String groupName);  }