@Test public void traderEventsAreSendToConfiguredMailAddress() throws MailSendingException { cut.tradeCompleted(someTrade); verify(mailSender).sendMail(eq(SOME_SENDER_ADDRESS), eq(SOME_RECIVER_ADDRESS), anyString(), eq(SOME_TEXT)); }
@Override public void tradeCompleted(final CompletedTrade trade) { final String subject = "Trade finished (" + trade.getType() + " " + trade.getSymbol() + " " + trade.getRelativeProfit().map(profit -> profit.toStringWithSign()).orElse("canceled") + ")"; safeSendMail(subject, formater.format(trade)); }
MailNotifier implements TraderNotifier { @Override public void tradeCompleted(final CompletedTrade trade) { final String subject = "Trade finished (" + trade.getType() + " " + trade.getSymbol() + " " + trade.getRelativeProfit().map(profit -> profit.toStringWithSign()).orElse("canceled") + ")"; safeSendMail(subject, formater.format(trade)); } }
MailNotifier implements TraderNotifier { @Override public void tradeCompleted(final CompletedTrade trade) { final String subject = "Trade finished (" + trade.getType() + " " + trade.getSymbol() + " " + trade.getRelativeProfit().map(profit -> profit.toStringWithSign()).orElse("canceled") + ")"; safeSendMail(subject, formater.format(trade)); } MailNotifier(final MailSender mailSender, final CompletedTradeMarkDownFormater formater,
            final AdmininstratorNotifier admin, final String sender, final String receiver); }
MailNotifier implements TraderNotifier { @Override public void tradeCompleted(final CompletedTrade trade) { final String subject = "Trade finished (" + trade.getType() + " " + trade.getSymbol() + " " + trade.getRelativeProfit().map(profit -> profit.toStringWithSign()).orElse("canceled") + ")"; safeSendMail(subject, formater.format(trade)); } MailNotifier(final MailSender mailSender, final CompletedTradeMarkDownFormater formater,
            final AdmininstratorNotifier admin, final String sender, final String receiver); @Override void tradeCompleted(final CompletedTrade trade); @Override void unexpectedEvent(final String message); }
MailNotifier implements TraderNotifier { @Override public void tradeCompleted(final CompletedTrade trade) { final String subject = "Trade finished (" + trade.getType() + " " + trade.getSymbol() + " " + trade.getRelativeProfit().map(profit -> profit.toStringWithSign()).orElse("canceled") + ")"; safeSendMail(subject, formater.format(trade)); } MailNotifier(final MailSender mailSender, final CompletedTradeMarkDownFormater formater,
            final AdmininstratorNotifier admin, final String sender, final String receiver); @Override void tradeCompleted(final CompletedTrade trade); @Override void unexpectedEvent(final String message);  }