@Test public void testConvertMessageWithBr() throws Exception { final String expectedMessage = "mes sage<br>"; final String message = serviceSpy.convertMessage(expectedMessage); assertEquals(expectedMessage, message); }
protected String convertMessage(String msg) throws Exception { StringBuilder sb = new StringBuilder(); for (int i = 0; i < msg.length(); i++) { char currentChar = msg.charAt(i); if (currentChar == '\n') { sb.append("<br>"); } else { sb.append(currentChar); } } return sb.toString(); }
GetMailMessageService { protected String convertMessage(String msg) throws Exception { StringBuilder sb = new StringBuilder(); for (int i = 0; i < msg.length(); i++) { char currentChar = msg.charAt(i); if (currentChar == '\n') { sb.append("<br>"); } else { sb.append(currentChar); } } return sb.toString(); } }
GetMailMessageService { protected String convertMessage(String msg) throws Exception { StringBuilder sb = new StringBuilder(); for (int i = 0; i < msg.length(); i++) { char currentChar = msg.charAt(i); if (currentChar == '\n') { sb.append("<br>"); } else { sb.append(currentChar); } } return sb.toString(); }  }
GetMailMessageService { protected String convertMessage(String msg) throws Exception { StringBuilder sb = new StringBuilder(); for (int i = 0; i < msg.length(); i++) { char currentChar = msg.charAt(i); if (currentChar == '\n') { sb.append("<br>"); } else { sb.append(currentChar); } } return sb.toString(); }  Map<String, String> execute(GetMailMessageInput getMailMessageInput); }
GetMailMessageService { protected String convertMessage(String msg) throws Exception { StringBuilder sb = new StringBuilder(); for (int i = 0; i < msg.length(); i++) { char currentChar = msg.charAt(i); if (currentChar == '\n') { sb.append("<br>"); } else { sb.append(currentChar); } } return sb.toString(); }  Map<String, String> execute(GetMailMessageInput getMailMessageInput);  }