File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
slack-api-client/src/test/java/test_with_remote_apis/methods Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1717import com .slack .api .model .block .SectionBlock ;
1818import com .slack .api .model .block .composition .MarkdownTextObject ;
1919import com .slack .api .model .block .element .BlockElements ;
20+ import com .slack .api .model .block .element .RichTextSectionElement ;
2021import config .Constants ;
2122import config .SlackTestConfig ;
2223import org .junit .AfterClass ;
@@ -337,4 +338,31 @@ public void richTextInputTest() throws Exception {
337338 // rich_text_input is not allowed in a channel message
338339 assertThat (response .getError (), is ("invalid_blocks" ));
339340 }
341+
342+ @ Test
343+ public void richTextMessage () throws Exception {
344+ loadRandomChannel ();
345+ ChatPostMessageResponse response = slack .methods (botToken ).chatPostMessage (r -> r
346+ .channel (randomChannelId )
347+ .text ("Hey! What's up?" )
348+ .blocks (Arrays .asList (
349+ richText (rt -> rt .blockId ("b" ).elements (Arrays .asList (
350+ richTextSection (rts -> rts .elements (Arrays .asList (
351+ RichTextSectionElement .Text .builder ()
352+ .style (RichTextSectionElement .TextStyle .builder ().code (true ).build ())
353+ .text ("Hey!" )
354+ .build (),
355+ RichTextSectionElement .Text .builder ()
356+ .text ("\n " )
357+ .build (),
358+ RichTextSectionElement .Text .builder ()
359+ .style (RichTextSectionElement .TextStyle .builder ().bold (true ).build ())
360+ .text ("What's up?" )
361+ .build ()
362+ )))
363+ )))
364+ ))
365+ );
366+ assertThat (response .getError (), is (nullValue ()));
367+ }
340368}
You can’t perform that action at this time.
0 commit comments