OrganizationManager { public Organization getById(String organizationId) throws NotFoundException, ServerException { requireNonNull(organizationId, "Required non-null organization id"); return organizationDao.getById(organizationId); } @Inject  OrganizationManager(
      EventService eventService,
      OrganizationDao organizationDao,
      MemberDao memberDao,
      @Named("che.auth.reserved_user_names") String[] reservedNames); @Transactional(rollbackOn = {RuntimeException.class, ApiException.class}) Organization create(Organization newOrganization); @Transactional(rollbackOn = {RuntimeException.class, ApiException.class}) Organization update(String organizationId, Organization update); @Transactional(rollbackOn = {RuntimeException.class, ApiException.class}) void remove(String organizationId); Organization getById(String organizationId); Organization getByName(String organizationName); Page<? extends Organization> getByParent(String parent, int maxItems, long skipCount); Page<OrganizationImpl> getSuborganizations(
      String parentQualifiedName, int maxItems, long skipCount); Page<? extends Organization> getByMember(String userId, int maxItems, int skipCount); Page<? extends Member> getMembers(String organizationId, int maxItems, long skipCount);  }
@Test(expectedExceptions = NullPointerException.class) public void shouldThrowNpeWhenGettingOrganizationByNullName() throws Exception { manager.getById(null); }
@Test(expectedExceptions = NullPointerException.class) public void shouldThrowNpeWhenGettingOrganizationByNullId() throws Exception { manager.getById(null); }
@Test public void shouldGetOrganizationById() throws Exception { final OrganizationImpl toFetch = new OrganizationImpl("org123", "toFetchOrg", "org321"); when(organizationDao.getById(eq("org123"))).thenReturn(toFetch); final Organization fetched = manager.getById("org123"); assertEquals(fetched, toFetch); verify(organizationDao).getById("org123"); }