AlertEntity { public void removeSpecialCharacters() { message = message.replaceAll("\r", " "); message = message.replaceAll("\n", " "); } AlertEntity(HostPort hostPort, String dc, String clusterId, String shardId,
                       String message, ALERT_TYPE alertType); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); String getKey(); String getDc(); void setDc(String dc); ALERT_TYPE getAlertType(); String getMessage(); AlertEntity setMessage(String message); HostPort getHostPort(); AlertEntity setHostPort(HostPort hostPort); String getClusterId(); AlertEntity setClusterId(String clusterId); String getShardId(); AlertEntity setShardId(String shardId); Date getDate(); AlertEntity setDate(Date date); void setAlertType(ALERT_TYPE alertType); void removeSpecialCharacters();  }
@Test public void testRemoveSpecialCharacters() { AlertEntity alertEntity = new AlertEntity(new HostPort("", 6379), "dc", "cluster", "shard", "message\nmessage1", ALERT_TYPE.CLIENT_INCONSIS); System.out.println(alertEntity.getMessage()); alertEntity.removeSpecialCharacters(); System.out.println(alertEntity.getMessage()); Assert.assertFalse(alertEntity.getMessage().contains("\n")); }