OrganizationEmailNotifications { public EmailBean organizationRenamed(String oldName, String newName) throws ServerException { Map<String, Object> attributes = new HashMap<>(); attributes.put("orgOldName", oldName); attributes.put("orgNewName", newName); return doBuildEmail(orgRenamedSubject, orgRenamedTemplate, attributes); } @Inject  OrganizationEmailNotifications(
      @Named("che.mail.from_email_address") String mailFrom,
      @Named("che.organization.email.member_added_subject") String memberAddedSubject,
      @Named("che.organization.email.member_added_template") String memberAddedTemplate,
      @Named("che.organization.email.member_removed_subject") String memberRemovedSubject,
      @Named("che.organization.email.member_removed_template") String memberRemovedTemplate,
      @Named("che.organization.email.org_removed_subject") String orgRemovedSubject,
      @Named("che.organization.email.org_removed_template") String orgRemovedTemplate,
      @Named("che.organization.email.org_renamed_subject") String orgRenamedSubject,
      @Named("che.organization.email.org_renamed_template") String orgRenamedTemplate,
      TemplateProcessor templateProcessor); EmailBean memberAdded(
      String organizationName, String dashboardEndpoint, String orgQualifiedName, String initiator); EmailBean memberRemoved(String organizationName, String initiator); EmailBean organizationRenamed(String oldName, String newName); EmailBean organizationRemoved(String organizationName);  }
@Test public void shouldReturnOrgRenamedEmail() throws Exception { EmailBean email = emails.organizationRenamed("Org", "SuperOrg"); assertEquals(email.getFrom(), MAIL_FROM); assertEquals(email.getReplyTo(), MAIL_FROM); assertEquals(email.getMimeType(), MediaType.TEXT_HTML); assertEquals(email.getSubject(), ORG_RENAMED_SUBJECT); verify(templateProcessor).process(eq(ORG_RENAMED_TEMPLATE), attributesCaptor.capture()); Map<String, Object> attributes = attributesCaptor.getValue(); assertEquals(attributes.get("orgOldName"), "Org"); assertEquals(attributes.get("orgNewName"), "SuperOrg"); }