ProjectOrganizationConverter implements Serializable { public AffMatchProjectOrganization convert(ProjectToOrganization projectOrganization) { Preconditions.checkNotNull(projectOrganization); Preconditions.checkArgument(StringUtils.isNotBlank(projectOrganization.getProjectId())); Preconditions.checkArgument(StringUtils.isNotBlank(projectOrganization.getOrganizationId())); return new AffMatchProjectOrganization(projectOrganization.getProjectId().toString(), projectOrganization.getOrganizationId().toString()); }  AffMatchProjectOrganization convert(ProjectToOrganization projectOrganization);  }
@Test(expected = NullPointerException.class) public void convert_null() { converter.convert(null); }
@Test(expected = IllegalArgumentException.class) public void convert_blank_organization_id() { converter.convert(new ProjectToOrganization(projId, " ")); }
@Test(expected = IllegalArgumentException.class) public void convert_blank_project_id() { converter.convert(new ProjectToOrganization(" ", orgId)); }
@Test(expected = IllegalArgumentException.class) public void convert_null_organization_id() { converter.convert(new ProjectToOrganization(projId, null)); }
@Test(expected = IllegalArgumentException.class) public void convert_null_project_id() { converter.convert(new ProjectToOrganization(null, orgId)); }
@Test public void convert() { AffMatchProjectOrganization result = converter.convert(new ProjectToOrganization(projId, orgId)); assertEquals(projId, result.getProjectId()); assertEquals(orgId, result.getOrganizationId()); }