Feat: We can play the code multiple times with different message
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 19s
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 19s
This commit is contained in:
@@ -2,7 +2,10 @@ import utils.*;
|
|||||||
|
|
||||||
public class Application {
|
public class Application {
|
||||||
public void run() {
|
public void run() {
|
||||||
SendNotificationFacade.sendNotifications();
|
String[] messages = new String[]{"Bonjour", "You got mail", "Je préfère C#", "Fin !"};
|
||||||
|
|
||||||
|
for (final String message: messages) {
|
||||||
|
SendNotificationFacade.sendNotifications(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public abstract class Notification {
|
|||||||
for (final NotificationDecoration decoration : decorations)
|
for (final NotificationDecoration decoration : decorations)
|
||||||
content = decoration.transformContent(content);
|
content = decoration.transformContent(content);
|
||||||
|
|
||||||
return strategy.makeContent(content);
|
return strategy.makeContent(content) + "\n";
|
||||||
}
|
}
|
||||||
setKoState();
|
setKoState();
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import static utils.NotificationType.Mail;
|
|||||||
import static utils.NotificationType.Sms;
|
import static utils.NotificationType.Sms;
|
||||||
|
|
||||||
public class SendNotificationFacade {
|
public class SendNotificationFacade {
|
||||||
public static void sendNotifications() {
|
public static void sendNotifications(String message) {
|
||||||
var notificationManager = NotificationManager.getInstance();
|
var notificationManager = NotificationManager.getInstance();
|
||||||
|
|
||||||
NotificationType[] typesThomas = {Sms, Mail, Push};
|
NotificationType[] typesThomas = {Sms, Mail, Push};
|
||||||
@@ -27,6 +27,6 @@ public class SendNotificationFacade {
|
|||||||
notificationManager.getObservable().addSubscribers(thomas);
|
notificationManager.getObservable().addSubscribers(thomas);
|
||||||
notificationManager.getObservable().addSubscribers(alexandre);
|
notificationManager.getObservable().addSubscribers(alexandre);
|
||||||
|
|
||||||
notificationManager.getObservable().sendNotifications("Je préfère C#");
|
notificationManager.getObservable().sendNotifications(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user