use of org.finra.herd.model.api.xml.UserNamespaceAuthorizations in project herd by FINRAOS.
the class UserNamespaceAuthorizationServiceTest method testGetUserNamespaceAuthorizationsByUserIdUpperCaseParameters.
@Test
public void testGetUserNamespaceAuthorizationsByUserIdUpperCaseParameters() throws Exception {
// Create a user namespace authorization key.
UserNamespaceAuthorizationKey key = new UserNamespaceAuthorizationKey(USER_ID, NAMESPACE);
// Create and persist the relative database entities.
UserNamespaceAuthorizationEntity userNamespaceAuthorizationEntity = userNamespaceAuthorizationDaoTestHelper.createUserNamespaceAuthorizationEntity(key, SUPPORTED_NAMESPACE_PERMISSIONS);
// Get user namespace authorizations for the specified user id using uppercase user id value.
UserNamespaceAuthorizations resultUserNamespaceAuthorizations = userNamespaceAuthorizationService.getUserNamespaceAuthorizationsByUserId(key.getUserId().toUpperCase());
// Validate the returned object.
assertEquals(new UserNamespaceAuthorizations(Arrays.asList(new UserNamespaceAuthorization(userNamespaceAuthorizationEntity.getId(), key, SUPPORTED_NAMESPACE_PERMISSIONS))), resultUserNamespaceAuthorizations);
}
use of org.finra.herd.model.api.xml.UserNamespaceAuthorizations in project herd by FINRAOS.
the class UserNamespaceAuthorizationServiceTest method testGetUserNamespaceAuthorizationsByNamespaceEmptyList.
@Test
public void testGetUserNamespaceAuthorizationsByNamespaceEmptyList() throws Exception {
// Create and persist the relative database entities.
namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
// Retrieve an empty list of user namespace authorizations.
UserNamespaceAuthorizations resultUserNamespaceAuthorizations = userNamespaceAuthorizationService.getUserNamespaceAuthorizationsByNamespace(NAMESPACE);
// Validate the returned object.
assertEquals(new UserNamespaceAuthorizations(), resultUserNamespaceAuthorizations);
}
use of org.finra.herd.model.api.xml.UserNamespaceAuthorizations in project herd by FINRAOS.
the class UserNamespaceAuthorizationServiceTest method testGetUserNamespaceAuthorizationsByNamespaceUpperCaseParameters.
@Test
public void testGetUserNamespaceAuthorizationsByNamespaceUpperCaseParameters() throws Exception {
// Create a user namespace authorization key.
UserNamespaceAuthorizationKey key = new UserNamespaceAuthorizationKey(USER_ID, NAMESPACE);
// Create and persist the relative database entities.
UserNamespaceAuthorizationEntity userNamespaceAuthorizationEntity = userNamespaceAuthorizationDaoTestHelper.createUserNamespaceAuthorizationEntity(key, SUPPORTED_NAMESPACE_PERMISSIONS);
// Get user namespace authorizations for the specified namespace using uppercase namespace code.
UserNamespaceAuthorizations resultUserNamespaceAuthorizations = userNamespaceAuthorizationService.getUserNamespaceAuthorizationsByNamespace(key.getNamespace().toUpperCase());
// Validate the returned object.
assertEquals(new UserNamespaceAuthorizations(Arrays.asList(new UserNamespaceAuthorization(userNamespaceAuthorizationEntity.getId(), key, SUPPORTED_NAMESPACE_PERMISSIONS))), resultUserNamespaceAuthorizations);
}
use of org.finra.herd.model.api.xml.UserNamespaceAuthorizations in project herd by FINRAOS.
the class UserNamespaceAuthorizationServiceTest method testGetUserNamespaceAuthorizationsByUserIdLowerCaseParameters.
@Test
public void testGetUserNamespaceAuthorizationsByUserIdLowerCaseParameters() throws Exception {
// Create a user namespace authorization key.
UserNamespaceAuthorizationKey key = new UserNamespaceAuthorizationKey(USER_ID, NAMESPACE);
// Create and persist the relative database entities.
UserNamespaceAuthorizationEntity userNamespaceAuthorizationEntity = userNamespaceAuthorizationDaoTestHelper.createUserNamespaceAuthorizationEntity(key, SUPPORTED_NAMESPACE_PERMISSIONS);
// Get user namespace authorizations for the specified user id using lowercase user id value.
UserNamespaceAuthorizations resultUserNamespaceAuthorizations = userNamespaceAuthorizationService.getUserNamespaceAuthorizationsByUserId(key.getUserId().toLowerCase());
// Validate the returned object.
assertEquals(new UserNamespaceAuthorizations(Arrays.asList(new UserNamespaceAuthorization(userNamespaceAuthorizationEntity.getId(), key, SUPPORTED_NAMESPACE_PERMISSIONS))), resultUserNamespaceAuthorizations);
}
use of org.finra.herd.model.api.xml.UserNamespaceAuthorizations in project herd by FINRAOS.
the class UserNamespaceAuthorizationServiceTest method testGetUserNamespaceAuthorizationsByUserIdTrimParameters.
@Test
public void testGetUserNamespaceAuthorizationsByUserIdTrimParameters() throws Exception {
// Create a user namespace authorization key.
UserNamespaceAuthorizationKey key = new UserNamespaceAuthorizationKey(USER_ID, NAMESPACE);
// Create and persist the relative database entities.
UserNamespaceAuthorizationEntity userNamespaceAuthorizationEntity = userNamespaceAuthorizationDaoTestHelper.createUserNamespaceAuthorizationEntity(key, SUPPORTED_NAMESPACE_PERMISSIONS);
// Get user namespace authorizations for the specified user id using user id value with leading and trailing empty spaces.
UserNamespaceAuthorizations resultUserNamespaceAuthorizations = userNamespaceAuthorizationService.getUserNamespaceAuthorizationsByUserId(addWhitespace(key.getUserId()));
// Validate the returned object.
assertEquals(new UserNamespaceAuthorizations(Arrays.asList(new UserNamespaceAuthorization(userNamespaceAuthorizationEntity.getId(), key, SUPPORTED_NAMESPACE_PERMISSIONS))), resultUserNamespaceAuthorizations);
}
Aggregations