/** * Removes IAM roles a namespace has authorizations to use. * * @param namespace The namespace of the authorizations to remove * * @return The namespace IAM role authorization */ @RequestMapping(value = "/namespaceIamRoleAuthorizations/namespaces/{namespace}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_NAMESPACE_IAM_ROLE_AUTHORIZATIONS_DELETE) public NamespaceIamRoleAuthorization deleteNamespaceIamRoleAuthorization(@PathVariable("namespace") String namespace) { return namespaceIamRoleAuthorizationService.deleteNamespaceIamRoleAuthorization(namespace); } }
/** * Removes IAM roles a namespace has authorizations to use. * * @param namespace The namespace of the authorizations to remove * * @return The namespace IAM role authorization */ @RequestMapping(value = "/namespaceIamRoleAuthorizations/namespaces/{namespace}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_NAMESPACE_IAM_ROLE_AUTHORIZATIONS_DELETE) public NamespaceIamRoleAuthorization deleteNamespaceIamRoleAuthorization(@PathVariable("namespace") String namespace) { return namespaceIamRoleAuthorizationService.deleteNamespaceIamRoleAuthorization(namespace); } }
/** * Asserts that deleteNamespaceIamRoleAuthorization() calls service with correct parameters, and returns whatever the service returns. */ @Test public void deleteNamespaceIamRoleAuthorizationAssertCallsService() { String expectedNamespace = "namespace"; NamespaceIamRoleAuthorization expectedResult = new NamespaceIamRoleAuthorization(); when(namespaceIamRoleAuthorizationService.deleteNamespaceIamRoleAuthorization(any())).thenReturn(expectedResult); NamespaceIamRoleAuthorization actualResult = namespaceIamRoleAuthorizationRestController.deleteNamespaceIamRoleAuthorization(expectedNamespace); verify(namespaceIamRoleAuthorizationService).deleteNamespaceIamRoleAuthorization(expectedNamespace); verifyNoMoreInteractions(namespaceIamRoleAuthorizationService); assertEquals(expectedResult, actualResult); }