@@ -367,7 +367,7 @@ void testWrongSchema_should_throw_illegal_argument() {
367367 }
368368
369369 @ Test
370- void testHeadCall () {
370+ void testHeadCall () throws InterruptedException {
371371 mockServer .enqueue (
372372 new MockResponse (
373373 200 ,
@@ -380,6 +380,7 @@ void testHeadCall() {
380380 "X-Custom-Header" ,
381381 "CustomValue" )),
382382 "" ));
383+
383384 assertDoesNotThrow (
384385 () -> {
385386 appl .workflowDefinition (
@@ -388,24 +389,33 @@ void testHeadCall() {
388389 .start ()
389390 .join ();
390391 });
392+
393+ RecordedRequest recordedRequest = mockServer .takeRequest ();
394+ SoftAssertions .assertSoftly (
395+ softly -> {
396+ softly .assertThat (recordedRequest .getMethod ()).isEqualTo ("HEAD" );
397+ softly .assertThat (recordedRequest .getUrl ().toString ()).contains ("/users/1" );
398+ });
391399 }
392400
393401 @ Test
394- void testOptionsCall () {
402+ void testOptionsCall () throws IOException , InterruptedException {
395403 mockServer .enqueue (new MockResponse (200 , Headers .of ("Allow" , "GET, POST, OPTIONS" ), "" ));
404+ appl .workflowDefinition (readWorkflowFromClasspath ("workflows-samples/call-http-options.yaml" ))
405+ .instance (Map .of ())
406+ .start ()
407+ .join ();
396408
397- assertDoesNotThrow (
398- () -> {
399- appl .workflowDefinition (
400- readWorkflowFromClasspath ("workflows-samples/call-http-options.yaml" ))
401- .instance (Map .of ())
402- .start ()
403- .join ();
409+ RecordedRequest recordedRequest = mockServer .takeRequest ();
410+ SoftAssertions .assertSoftly (
411+ softly -> {
412+ softly .assertThat (recordedRequest .getMethod ()).isEqualTo ("OPTIONS" );
413+ softly .assertThat (recordedRequest .getUrl ().toString ()).contains ("/users/1" );
404414 });
405415 }
406416
407417 @ Test
408- void testRedirectAsFalse () {
418+ void testRedirect_should_throws_when_redirect_is_false_and_response_status_is_not_2xx () {
409419 mockServer .enqueue (
410420 new MockResponse (301 , Headers .of ("Location" , "http://localhost:9876/redirected" ), "" ));
411421
@@ -419,7 +429,6 @@ void testRedirectAsFalse() {
419429 .instance (Map .of ())
420430 .start ()
421431 .join ());
422-
423432 assertThat (exception .getCause ().getMessage ())
424433 .contains (
425434 "The property 'redirect' is set to false but received status 301 (Redirection); expected status in the 200-299 range" );
0 commit comments