use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method shouldRemoveOrganization.
@Test(dependsOnMethods = "shouldThrowNotFoundExceptionOnGettingNonExistingOrganizationById")
public void shouldRemoveOrganization() throws Exception {
// given
final OrganizationImpl organization = organizations[0];
// when
organizationDao.remove(organization.getId());
// then
assertNull(notFoundToNull(() -> organizationDao.getById(organization.getId())));
}
use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method shouldUpdateOrganization.
@Test
public void shouldUpdateOrganization() throws Exception {
final OrganizationImpl toUpdate = new OrganizationImpl(organizations[0].getId(), "new-name", null);
organizationDao.update(toUpdate);
final OrganizationImpl updated = organizationDao.getById(toUpdate.getId());
assertEquals(toUpdate, updated);
}
use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method setUp.
@BeforeMethod
private void setUp() throws TckRepositoryException {
organizations = new OrganizationImpl[2];
organizations[0] = new OrganizationImpl(NameGenerator.generate("organization", 10), "test1", null);
organizations[1] = new OrganizationImpl(NameGenerator.generate("organization", 10), "test2", null);
tckRepository.createAll(asList(organizations));
}
use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method shouldGetSuborganizations.
@Test
public void shouldGetSuborganizations() throws Exception {
final OrganizationImpl parent = organizations[0];
final OrganizationImpl child1 = new OrganizationImpl("child1", parent.getQualifiedName() + "/childTest1", parent.getId());
final OrganizationImpl child2 = new OrganizationImpl("child2", child1.getQualifiedName() + "/childTest2", child1.getId());
final OrganizationImpl child3 = new OrganizationImpl("child3", parent.getQualifiedName() + "/childTest3", parent.getId());
tckRepository.createAll(asList(child1, child2, child3));
final List<OrganizationImpl> suborganizations = Pages.stream((maxItems, skipCount) -> organizationDao.getSuborganizations(parent.getQualifiedName(), maxItems, skipCount), 1).collect(Collectors.toList());
assertEquals(suborganizations.size(), 3);
}
use of org.eclipse.che.multiuser.organization.spi.impl.OrganizationImpl in project devspaces-images by redhat-developer.
the class OrganizationDaoTest method shouldCreateOrganization.
@Test
public void shouldCreateOrganization() throws Exception {
final OrganizationImpl organization = new OrganizationImpl("organization123", "Test", null);
organizationDao.create(organization);
assertEquals(organizationDao.getById(organization.getId()), organization);
}
Aggregations