313233343536373839
public class SimpleMessageTest extends AbstractMessageContextAwareTest { @Test public void createInlineMessageTest() { Message message = this.messageContext.message().text("hello open message").create(); assertEquals("hello open message", message.toString(this.messageContext)); }
394041424344454647
} @Test public void createInlineMessageViaMessageBuilderTest() { Message message = SimpleMessageBuilder.message().text("hello open message").create(); assertEquals("hello open message", message.toString(this.messageContext)); }
474849505152535455
} @Test public void createInlineMessageViaCustomMessageBuilderTest() { Message message = TestMessageBuilder.message().text("hello open message").create(); assertEquals("hello open message", message.toString(this.messageContext)); }
555657585960616263
} @Test public void resolveMessageTest() { Message message = this.messageContext.message().text("{hello}").create(); checkDefaultHelloMessage(message.toString(this.messageContext)); }
636465666768697071727374
} @Test public void resolveMessageTextTest() { Message message = this.messageContext.message().text("{hello}").create(); @SuppressWarnings({"deprecation"}) String messageText = message.toString(this.messageContext); checkDefaultHelloMessage(messageText); }
848586878889909192
} @Test public void directMessage2TextResolvingTest() { Message message = new DefaultMessage("inline message"); assertEquals("inline message", message.toString()); }
9293949596979899100
} @Test public void manuallyCreateInlineMessageTest() { Message message = new DefaultMessage("inline message"); assertEquals("inline message", message.toString(this.messageContext)); }
100101102103104105106107
} @Test public void manuallyCreateMessageWithConfigTest() { Message message = manuallyCreateDefaultMessage(); checkDefaultHelloMessage(message.toString()); }
128129130131132133134135136
} @Test public void createMessageWithHiddenArgumentsTest() { Message message = new TestMessage("{xyz123}").addArgument("123", 456, "789"); assertEquals("???xyz123??? (123,456,789)", message.toString(this.messageContext)); }
144145146147148149150151152153
} @Test public void directTextResolvingTest() { Message message = this.messageContext.message().text("{hello}").create(); String messageText = message.toString(this.messageContext); checkDefaultHelloMessage(messageText); }