use of io.gravitee.rest.api.model.PrimaryOwnerEntity in project gravitee-management-rest-api by gravitee-io.
the class ApiService_FindPrimaryOwnerTest method testHybridModeWithNonExistingPOGroupAndCurrentUserBelongsToAPoGroup.
@Test
public void testHybridModeWithNonExistingPOGroupAndCurrentUserBelongsToAPoGroup() {
setPrimaryOwnerMode("HYBRID");
setPoGroupNonExisting();
addUserInPOGroup(CURRENT_USER, CURRENT_USER_PO_GROUP);
JsonNode definition = poGroupDefinition();
final PrimaryOwnerEntity primaryOwner = apiService.findPrimaryOwner(definition, CURRENT_USER);
assertEquals(CURRENT_USER_PO_GROUP, primaryOwner.getId());
assertEquals("GROUP", primaryOwner.getType());
}
use of io.gravitee.rest.api.model.PrimaryOwnerEntity in project gravitee-management-rest-api by gravitee-io.
the class ApiService_FindPrimaryOwnerTest method testHybridModeWithExistingPOUser.
// HYBRID + import with PO User
@Test
public void testHybridModeWithExistingPOUser() {
setPrimaryOwnerMode("HYBRID");
defineUser(PO_USER_ID);
JsonNode definition = poUserDefinition();
final PrimaryOwnerEntity primaryOwner = apiService.findPrimaryOwner(definition, CURRENT_USER);
assertEquals(PO_USER_ID, primaryOwner.getId());
assertEquals("USER", primaryOwner.getType());
}
use of io.gravitee.rest.api.model.PrimaryOwnerEntity in project gravitee-management-rest-api by gravitee-io.
the class ApiService_FindPrimaryOwnerTest method testHybridModeWithNonExistingPOUser.
@Test
public void testHybridModeWithNonExistingPOUser() {
setPrimaryOwnerMode("HYBRID");
setPoUserNonExisting();
defineUser(CURRENT_USER);
JsonNode definition = poUserDefinition();
final PrimaryOwnerEntity primaryOwner = apiService.findPrimaryOwner(definition, CURRENT_USER);
assertEquals(CURRENT_USER, primaryOwner.getId());
assertEquals("USER", primaryOwner.getType());
}
use of io.gravitee.rest.api.model.PrimaryOwnerEntity in project gravitee-management-rest-api by gravitee-io.
the class ApiService_FindPrimaryOwnerTest method testUserModeWithPOGroup.
// USER + import with PO GROUP
@Test
public void testUserModeWithPOGroup() {
setPrimaryOwnerMode("USER");
defineUser(CURRENT_USER);
JsonNode definition = poGroupDefinition();
final PrimaryOwnerEntity primaryOwner = apiService.findPrimaryOwner(definition, CURRENT_USER);
assertEquals(CURRENT_USER, primaryOwner.getId());
assertEquals("USER", primaryOwner.getType());
}
use of io.gravitee.rest.api.model.PrimaryOwnerEntity in project gravitee-management-rest-api by gravitee-io.
the class ApiService_FindPrimaryOwnerTest method testHybridModeWithExistingPOGroup.
// HYBRID + import with PO GROUP
@Test
public void testHybridModeWithExistingPOGroup() {
setPrimaryOwnerMode("HYBRID");
defineGroup(PO_GROUP_ID);
JsonNode definition = poGroupDefinition();
final PrimaryOwnerEntity primaryOwner = apiService.findPrimaryOwner(definition, CURRENT_USER);
assertEquals(PO_GROUP_ID, primaryOwner.getId());
assertEquals("GROUP", primaryOwner.getType());
}
Aggregations