@Test public void getAuthenticationMounts() throws Exception { String token = "4EpPYDSfgN2D4Gf7UmNO3nuL"; String mountAccessor = "auth_oidc"; String data = "{\n \"data\": {\n \"canonical_id\": \"7862bbe1-16ce-442d-756b-585ed77b7385\",\n \"creation_time\": \"2020-07-15T14:07:14.7237705Z\",\n \"id\": \"dea21830-f565-77d6-3005-8aab0c2596bb\",\n \"last_update_time\": \"2020-07-15T14:07:14.7237705Z\",\n \"merged_from_canonical_ids\": null,\n \"metadata\": null,\n \"mount_accessor\": \"auth_oidc_8b51f292\",\n \"mount_path\": \"auth/oidc/\",\n \"mount_type\": \"oidc\",\n \"name\": \"Nithin.Nazeer1@T-Mobile.com\",\n \"namespace_id\": \"root\"\n }\n}"; Response response = getMockResponse(HttpStatus.OK, true, data); ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(mountAccessor); when(OIDCUtil.fetchMountAccessorForOidc(token)).thenReturn(mountAccessor); when(reqProcessor.process("/sys/list", "{}", token)).thenReturn(response); ResponseEntity<String> responseEntity = oidcAuthService.getAuthenticationMounts(token); assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); assertEquals(responseEntityExpected, responseEntity); }
public ResponseEntity<String> getAuthenticationMounts(String token) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "List Auth Methods").put(LogMessage.MESSAGE, "Trying to get all auth Methods") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); String mountAccessor = oidcUtil.fetchMountAccessorForOidc(token); return ResponseEntity.status(HttpStatus.OK).body(mountAccessor); }
OIDCAuthService { public ResponseEntity<String> getAuthenticationMounts(String token) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "List Auth Methods").put(LogMessage.MESSAGE, "Trying to get all auth Methods") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); String mountAccessor = oidcUtil.fetchMountAccessorForOidc(token); return ResponseEntity.status(HttpStatus.OK).body(mountAccessor); } }
OIDCAuthService { public ResponseEntity<String> getAuthenticationMounts(String token) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "List Auth Methods").put(LogMessage.MESSAGE, "Trying to get all auth Methods") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); String mountAccessor = oidcUtil.fetchMountAccessorForOidc(token); return ResponseEntity.status(HttpStatus.OK).body(mountAccessor); }  }
OIDCAuthService { public ResponseEntity<String> getAuthenticationMounts(String token) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "List Auth Methods").put(LogMessage.MESSAGE, "Trying to get all auth Methods") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); String mountAccessor = oidcUtil.fetchMountAccessorForOidc(token); return ResponseEntity.status(HttpStatus.OK).body(mountAccessor); }  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> getAuthenticationMounts(String token) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "List Auth Methods").put(LogMessage.MESSAGE, "Trying to get all auth Methods") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); String mountAccessor = oidcUtil.fetchMountAccessorForOidc(token); return ResponseEntity.status(HttpStatus.OK).body(mountAccessor); }  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);  }