### Question:
UserDeployer implements Deployer { @Override public void deployIn(IItem item) { if (isDeployable(attribute, item)) { item.setDeploy(attribute, getUser(getUserId(item))); } } UserDeployer(DatastoreHasGet<UserItem> getter, String attribute); @Override String getDeployedAttribute(); @Override void deployIn(IItem item);  }### Answer:
@Test public void testDeployableAttributeIsDeployed() throws Exception { UserItem user = prepareGetterToReturnAUser(); ReportItem report = aReportInstalledBy(APIID.makeAPIID(6L)); UserDeployer installedByDeployer = new UserDeployer(getter, ReportItem.ATTRIBUTE_INSTALLED_BY); installedByDeployer.deployIn(report); assertEquals(user, report.getInstalledBy()); }
@Test public void testNotDeployableAttributeIsNotDeployed() throws Exception { prepareGetterToReturnAUser(); ReportItem report = aReportInstalledBy(null); UserDeployer nameDeployer = new UserDeployer(getter, ReportItem.ATTRIBUTE_INSTALLED_BY); nameDeployer.deployIn(report); assertNull(report.getInstalledBy()); }