Skip to content

Commit

Permalink
Fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fragosoluana committed Dec 17, 2024
1 parent 72c2930 commit 07e15d4
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions src/test/java/com/yelp/nrtsearch/server/logging/HitsLoggerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,22 +212,22 @@ public void testCustomHitsLoggerWithoutParam() {
@Test
public void testResponseSizeReductionWithHitsToLogSameAsHitsCount() {
SearchRequest request =
SearchRequest.newBuilder()
.setTopHits(5)
.setStartHit(0)
.setIndexName(DEFAULT_TEST_INDEX)
.addRetrieveFields("doc_id")
.setQuery(
Query.newBuilder()
.setTermQuery(
TermQuery.newBuilder()
.setField("vendor_name")
.setTextValue("vendor")
.build())
.build())
.setLoggingHits(
LoggingHits.newBuilder().setName("custom_logger").setHitsToLog(5).build())
.build();
SearchRequest.newBuilder()
.setTopHits(5)
.setStartHit(0)
.setIndexName(DEFAULT_TEST_INDEX)
.addRetrieveFields("doc_id")
.setQuery(
Query.newBuilder()
.setTermQuery(
TermQuery.newBuilder()
.setField("vendor_name")
.setTextValue("vendor")
.build())
.build())
.setLoggingHits(
LoggingHits.newBuilder().setName("custom_logger").setHitsToLog(5).build())
.build();
SearchResponse response = getGrpcServer().getBlockingStub().search(request);
String expectedLogMessage = "LOGGED doc_id: 0, doc_id: 1, doc_id: 2, doc_id: 3, doc_id: 4, ";

Expand Down Expand Up @@ -273,25 +273,25 @@ public void testResponseSizeReductionWithHitsToLogGreaterThanHitsCount() {
@Test
public void testResponseSizeReductionWithHitsToLogGreaterThanHitsCountAndTotalDocs() {
SearchRequest request =
SearchRequest.newBuilder()
.setTopHits(10)
.setStartHit(0)
.setIndexName(DEFAULT_TEST_INDEX)
.addRetrieveFields("doc_id")
.setQuery(
Query.newBuilder()
.setTermQuery(
TermQuery.newBuilder()
.setField("vendor_name")
.setTextValue("vendor")
.build())
.build())
.setLoggingHits(
LoggingHits.newBuilder().setName("custom_logger").setHitsToLog(15).build())
.build();
SearchRequest.newBuilder()
.setTopHits(10)
.setStartHit(0)
.setIndexName(DEFAULT_TEST_INDEX)
.addRetrieveFields("doc_id")
.setQuery(
Query.newBuilder()
.setTermQuery(
TermQuery.newBuilder()
.setField("vendor_name")
.setTextValue("vendor")
.build())
.build())
.setLoggingHits(
LoggingHits.newBuilder().setName("custom_logger").setHitsToLog(15).build())
.build();
SearchResponse response = getGrpcServer().getBlockingStub().search(request);
String expectedLogMessage =
"LOGGED doc_id: 0, doc_id: 1, doc_id: 2, doc_id: 3, doc_id: 4, doc_id: 5, doc_id: 6, doc_id: 7, doc_id: 8, doc_id: 9, ";
"LOGGED doc_id: 0, doc_id: 1, doc_id: 2, doc_id: 3, doc_id: 4, doc_id: 5, doc_id: 6, doc_id: 7, doc_id: 8, doc_id: 9, ";

assertEquals(expectedLogMessage, HitsLoggerTest.logMessage);
assertEquals(10, response.getTotalHits().getValue());
Expand All @@ -301,22 +301,22 @@ public void testResponseSizeReductionWithHitsToLogGreaterThanHitsCountAndTotalDo
@Test
public void testResponseSizeReductionWithHitsToLogLessThanHitsCount() {
SearchRequest request =
SearchRequest.newBuilder()
.setTopHits(5)
.setStartHit(0)
.setIndexName(DEFAULT_TEST_INDEX)
.addRetrieveFields("doc_id")
.setQuery(
Query.newBuilder()
.setTermQuery(
TermQuery.newBuilder()
.setField("vendor_name")
.setTextValue("vendor")
.build())
.build())
.setLoggingHits(
LoggingHits.newBuilder().setName("custom_logger").setHitsToLog(3).build())
.build();
SearchRequest.newBuilder()
.setTopHits(5)
.setStartHit(0)
.setIndexName(DEFAULT_TEST_INDEX)
.addRetrieveFields("doc_id")
.setQuery(
Query.newBuilder()
.setTermQuery(
TermQuery.newBuilder()
.setField("vendor_name")
.setTextValue("vendor")
.build())
.build())
.setLoggingHits(
LoggingHits.newBuilder().setName("custom_logger").setHitsToLog(3).build())
.build();
SearchResponse response = getGrpcServer().getBlockingStub().search(request);
String expectedLogMessage = "LOGGED doc_id: 0, doc_id: 1, doc_id: 2, ";

Expand Down

0 comments on commit 07e15d4

Please sign in to comment.