Skip to content

Commit

Permalink
🚚 (#236): Rename example template
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Klaus committed Feb 7, 2025
1 parent bb87f08 commit 03a7924
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package app.hopps.commons.mail;

public enum MailTemplates {
TEMP
EXAMPLE
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ void testEquals() {

@Test
void testToString() {
Mail mail = new Mail(new String[] { "[email protected]", "[email protected]" }, MailTemplates.TEMP, Map.of());
Mail mail = new Mail(new String[] { "[email protected]", "[email protected]" }, MailTemplates.EXAMPLE, Map.of());

String expected = "Mail{mailReceivers=[[email protected], [email protected]], templateId=TEMP, variables={}}";
String expected = "Mail{mailReceivers=[[email protected], [email protected]], templateId=EXAMPLE, variables={}}";

String actual = mail.toString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Uni<Void> handleRequest(Mail mail) {
private Function<Map<String, String>, MailTemplate.MailTemplateInstance> getTemplateByType(
MailTemplates mailTemplates) {
return switch (mailTemplates) {
case TEMP -> Templates::temp;
case EXAMPLE -> Templates::example;
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ private Templates() {
// static methods only
}

public static native MailTemplate.MailTemplateInstance temp(Map<String, String> mapping);
public static native MailTemplate.MailTemplateInstance example(Map<String, String> mapping);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ public class KafkaTestResourceLifecycleManager implements QuarkusTestResourceLif

@Override
public Map<String, String> start() {
Map<String, String> env = new HashMap<>();
Map<String, String> props1 = InMemoryConnector.switchIncomingChannelsToInMemory("mail");
env.putAll(props1);
return env;
Map<String, String> mailKafkaProperties = InMemoryConnector.switchIncomingChannelsToInMemory("mail");
return new HashMap<>(mailKafkaProperties);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void shouldSendMail() {
InMemorySource<Mail> mailSender = connector.source("mail");
mailSender.runOnVertxContext(true);

Mail mail = new Mail(new String[] { "[email protected]" }, MailTemplates.TEMP, Map.of("name", "Peter"));
Mail mail = new Mail(new String[] { "[email protected]" }, MailTemplates.EXAMPLE, Map.of("name", "Peter"));

// when
mailSender.send(mail);
Expand All @@ -58,7 +58,7 @@ void shouldSendMultipleMailsParallel() {
InMemorySource<Mail> mailSender = connector.source("mail");
mailSender.runOnVertxContext(true);

Mail mail = new Mail(new String[] { "[email protected]" }, MailTemplates.TEMP, Map.of("name", "Peter"));
Mail mail = new Mail(new String[] { "[email protected]" }, MailTemplates.EXAMPLE, Map.of("name", "Peter"));

// when
for (int i = 0; i < 500; i++) {
Expand Down

0 comments on commit 03a7924

Please sign in to comment.