@Test public void shouldGetEmailContentForPackageMaterial() { PackageMaterial material = new PackageMaterial(); PackageRepository repository = PackageRepositoryMother.create("repo-id", "repo-name", "pluginid", "version", new Configuration(ConfigurationPropertyMother.create("k1", false, "v1"))); material.setPackageDefinition(PackageDefinitionMother.create("p-id", "package-name", new Configuration(ConfigurationPropertyMother.create("k2", false, "v2")), repository)); StringBuilder content = new StringBuilder(); Date date = new Date(1367472329111L); material.emailContent(content, new Modification(null, null, null, date, "rev123")); assertThat(content.toString(), is(String.format("Package : repo-name:package-name\nrevision: rev123, completed on %s", date.toString()))); }