use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method shouldGetOrganizationByName.
@Test
public void shouldGetOrganizationByName() throws Exception {
final OrganizationImpl organization = organizations[0];
final OrganizationImpl found = organizationDao.getByName(organization.getName());
assertEquals(organization, found);
}
use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method shouldThrowConflictExceptionOnCreatingOrganizationWithExistingName.
@Test(expectedExceptions = ConflictException.class)
public void shouldThrowConflictExceptionOnCreatingOrganizationWithExistingName() throws Exception {
final OrganizationImpl organization = new OrganizationImpl("organization123", organizations[0].getName(), null);
organizationDao.create(organization);
assertEquals(organizationDao.getById(organization.getId()), organization);
}
use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method shouldGetOrganizationById.
@Test
public void shouldGetOrganizationById() throws Exception {
final OrganizationImpl organization = organizations[0];
final OrganizationImpl found = organizationDao.getById(organization.getId());
assertEquals(organization, found);
}
use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method shouldThrowNotFoundExceptionOnUpdatingNonExistingOrganization.
@Test(expectedExceptions = NotFoundException.class)
public void shouldThrowNotFoundExceptionOnUpdatingNonExistingOrganization() throws Exception {
final OrganizationImpl toUpdate = new OrganizationImpl("non-existing-id", "new-name", "new-parent");
organizationDao.update(toUpdate);
}
use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDistributedResourcesDaoTest method setUp.
@BeforeMethod
private void setUp() throws Exception {
parentOrganization = new OrganizationImpl("parentOrg", "parentOrgName", null);
suborganizations = new OrganizationImpl[ORGANIZATION_RESOURCES_COUNT];
distributedResources = new OrganizationDistributedResourcesImpl[ORGANIZATION_RESOURCES_COUNT];
for (int i = 0; i < ORGANIZATION_RESOURCES_COUNT; i++) {
suborganizations[i] = new OrganizationImpl("suborgId-" + i, "suborgName" + i, parentOrganization.getId());
distributedResources[i] = new OrganizationDistributedResourcesImpl(suborganizations[i].getId(), singletonList(new ResourceImpl(TEST_RESOURCE_TYPE, i, "test")));
}
organizationsRepository.createAll(Collections.singletonList(parentOrganization));
organizationsRepository.createAll(Arrays.asList(suborganizations));
distributedResourcesRepository.createAll(Arrays.asList(distributedResources));
}
Aggregations