Source:
public void generatesExpectedMessage ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.author = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockEvent.comment = "This is the first line\nAnd the second line." ; mockChange.number = 1234 ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.owner = mockOwner ; mockOwner.name = "Owner" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\n" + ( ( ( ( ( ( ( ( ( ( ( ( " \"channel\": \"#testchannel\",\n" + " \"attachments\": [\n" ) + " {\n" ) + " \"fallback\": \"Unit Tester commented on - testproject (master) - https://change/ - This is the first line\nAnd the second line.\",\n" ) + " \"pretext\": \"Unit Tester commented on\",\n" ) + " \"title\": \"testproject (master) - change 1234\",\n" ) + " \"title_link\": \"https://change/\",\n" ) + " \"text\": \"This is the first line\n" ) + "And the second line.\",\n" ) + " \"color\": \"good\"\n" ) + " }\n" ) + " ]\n" ) + "}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessage ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.author = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockEvent.comment = "This is the comment body." ; mockChange.number = 1234 ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.owner = mockOwner ; mockOwner.name = "Owner" ; mockChange.commitMessage = "This is the title\nThis is the message body." ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\n" + ( ( ( ( ( ( ( ( ( ( ( " \"channel\": \"#testchannel\",\n" + " \"attachments\": [\n" ) + " {\n" ) + " \"fallback\": \"Unit Tester commented on testproject (master) https://change/: This is the title\",\n" ) + " \"pretext\": \"Unit Tester commented on <https://change/|testproject (master) change 1234>\",\n" ) + " \"title\": \"This is the title\",\n" ) + " \"title_link\": \"https://change/\",\n" ) + " \"text\": \"This is the comment body.\",\n" ) + " \"color\": \"good\"\n" ) + " }\n" ) + " ]\n" ) + "}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }