@Test public void testSaveSpace() { final SpacesScreenService.NewSpace space = new SpacesScreenService.NewSpace() {{ name = "test"; groupId = "com.test"; description="Test space"; }}; final List<Contributor> contributors = new ArrayList<>(); contributors.add(new Contributor(sessionInfo.getIdentity().getIdentifier(), ContributorType.OWNER)); assertEquals(201, spacesScreenService.postSpace(space).getStatus()); verify(organizationalUnitService).createOrganizationalUnit("test", "com.test", new ArrayList<>(), contributors, "Test space"); }
@Override public Response postSpace(final NewSpace newSpace) { organizationalUnitService.createOrganizationalUnit(newSpace.name, newSpace.groupId, new ArrayList<>(), getContributors(), newSpace.description); return Response.status(201).build(); }
SpacesScreenServiceImpl implements SpacesScreenService { @Override public Response postSpace(final NewSpace newSpace) { organizationalUnitService.createOrganizationalUnit(newSpace.name, newSpace.groupId, new ArrayList<>(), getContributors(), newSpace.description); return Response.status(201).build(); } }
SpacesScreenServiceImpl implements SpacesScreenService { @Override public Response postSpace(final NewSpace newSpace) { organizationalUnitService.createOrganizationalUnit(newSpace.name, newSpace.groupId, new ArrayList<>(), getContributors(), newSpace.description); return Response.status(201).build(); } SpacesScreenServiceImpl(); @Inject  SpacesScreenServiceImpl(final OrganizationalUnitService organizationalUnitService,
                                   final SessionInfo sessionInfo); }
SpacesScreenServiceImpl implements SpacesScreenService { @Override public Response postSpace(final NewSpace newSpace) { organizationalUnitService.createOrganizationalUnit(newSpace.name, newSpace.groupId, new ArrayList<>(), getContributors(), newSpace.description); return Response.status(201).build(); } SpacesScreenServiceImpl(); @Inject  SpacesScreenServiceImpl(final OrganizationalUnitService organizationalUnitService,
                                   final SessionInfo sessionInfo); @Override Collection<OrganizationalUnit> getSpaces(); @Override OrganizationalUnit getSpace(final String name); @Override boolean isValidGroupId(final String groupId); @Override Response postSpace(final NewSpace newSpace); }
SpacesScreenServiceImpl implements SpacesScreenService { @Override public Response postSpace(final NewSpace newSpace) { organizationalUnitService.createOrganizationalUnit(newSpace.name, newSpace.groupId, new ArrayList<>(), getContributors(), newSpace.description); return Response.status(201).build(); } SpacesScreenServiceImpl(); @Inject  SpacesScreenServiceImpl(final OrganizationalUnitService organizationalUnitService,
                                   final SessionInfo sessionInfo); @Override Collection<OrganizationalUnit> getSpaces(); @Override OrganizationalUnit getSpace(final String name); @Override boolean isValidGroupId(final String groupId); @Override Response postSpace(final NewSpace newSpace);  }