entities = MessageUtils.getEntities(testMessage);
assertThat(entities.size(), is(6));
assertThat(entities.stream().filter(e -> e.getType().equals("q")).count(), is(1L));
assertThat(entities.stream().filter(e -> e.getType().equals("u")).count(), is(1L));
assertThat(entities.stream().filter(e -> e.getType().equals("a")).count(), is(4L));
Entity yo = entities.stream().filter(e -> e.getType().equals("q")).findFirst().orElseThrow(IllegalStateException::new);
assertThat(yo.getText(), is("how ?"));
assertThat(yo.getStart(), is(0));
assertThat(yo.getEnd(), is(7));
}
@Test
public void ActivityStreamsHTMLtoMarkdownTest() {
String text = "@stanislavv я в @rf выкладывал =)
";
Options options = new Options();
options.inlineLinks = true;
Remark remark = new Remark(options);
String parsed = remark.convertFragment(text);
}
@Test
public void messageFormatTest() {
String msg = "> quote\nmessage";
assertThat(MessageUtils.formatMessage(msg), is("quote
message"));
String brokenComment = "