File tree Expand file tree Collapse file tree 1 file changed +32
-2
lines changed
slack-api-client/src/test/java/test_with_remote_apis/methods Expand file tree Collapse file tree 1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change 2222import org .junit .Test ;
2323
2424import java .util .Arrays ;
25+ import java .util .Collections ;
2526import java .util .List ;
2627
27- import static org .hamcrest .CoreMatchers .is ;
28- import static org .hamcrest .CoreMatchers .nullValue ;
28+ import static org .hamcrest .CoreMatchers .*;
2929import static org .hamcrest .MatcherAssert .assertThat ;
3030
3131@ Slf4j
@@ -160,4 +160,34 @@ public void standalone_canvases_error() throws Exception {
160160 );
161161 assertThat (creation .getError (), is ("invalid_arguments" ));
162162 }
163+
164+ @ Test
165+ public void error_detail () throws Exception {
166+ MethodsClient client = slack .methods (botToken );
167+ // canvases.create
168+ {
169+ CanvasesCreateResponse response = client .canvasesCreate (r -> r
170+ .title ("test" )
171+ .documentContent (CanvasDocumentContent .builder ()
172+ .markdown ("test" )
173+ .type ("invalid" )
174+ .build ())
175+ );
176+ assertThat (response .isOk (), is (false ));
177+ assertThat (response .getError (), is ("invalid_arguments" ));
178+ assertThat (response .getDetail (), is (notNullValue ()));
179+ }
180+ // canvases.edit
181+ {
182+ CanvasesEditResponse response = client .canvasesEdit (r -> r
183+ .canvasId ("F123" )
184+ .changes (Collections .singletonList (CanvasDocumentChange .builder ()
185+ .documentContent (CanvasDocumentContent .builder ().markdown ("foo" ).type ("invalid" ).build ())
186+ .build ()))
187+ );
188+ assertThat (response .isOk (), is (false ));
189+ assertThat (response .getError (), is ("invalid_arguments" ));
190+ assertThat (response .getDetail (), is (notNullValue ()));
191+ }
192+ }
163193}
You can’t perform that action at this time.
0 commit comments