Skip to content

Commit 646bf12

Browse files
committed
HSEARCH-5464 Adjust elasticsearch-java tests
since the behavior of this client is slightly different
1 parent 735c245 commit 646bf12

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

integrationtest/backend/elasticsearch/src/test/java/org/hibernate/search/integrationtest/backend/elasticsearch/client/ElasticsearchClientFactoryImplElasticsearchJavaIT.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ void multipleHosts_failover_serverError() {
627627
assertThat( result.statusCode() ).as( "status code" ).isEqualTo( 200 );
628628

629629
wireMockRule1.verify( 2, postRequestedFor( urlPathMatching( "/myIndex/myType" ) ) );
630-
wireMockRule2.verify( 1, postRequestedFor( urlPathMatching( "/myIndex/myType" ) ) );
630+
wireMockRule2.verify( 2, postRequestedFor( urlPathMatching( "/myIndex/myType" ) ) );
631631

632632
wireMockRule1.resetRequests();
633633
wireMockRule2.resetRequests();
@@ -875,6 +875,11 @@ void authentication() {
875875

876876
String payload = "{ \"foo\": \"bar\" }";
877877

878+
wireMockRule1.stubFor( post( urlPathMatching( "/myIndex/myType/_search" ) )
879+
.withRequestBody( equalToJson( payload ) )
880+
.willReturn( elasticsearchResponse().withStatus( 401 )
881+
.withHeader( "www-authenticate", "Basic realm=\"IT Realm\"" ) ) );
882+
878883
wireMockRule1.stubFor( post( urlPathMatching( "/myIndex/myType/_search" ) )
879884
.withBasicAuth( username, password )
880885
.withRequestBody( equalToJson( payload ) )

0 commit comments

Comments
 (0)