From 38eda5f3f81ca2e344d6bd662bea3a1c76ec98f2 Mon Sep 17 00:00:00 2001 From: zhichao-aws Date: Tue, 27 Feb 2024 10:39:11 +0800 Subject: [PATCH] optimize assert in ut Signed-off-by: zhichao-aws --- .../processor/NeuralQueryEnricherProcessorTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/opensearch/neuralsearch/processor/NeuralQueryEnricherProcessorTests.java b/src/test/java/org/opensearch/neuralsearch/processor/NeuralQueryEnricherProcessorTests.java index b811766f6..05d7298ee 100644 --- a/src/test/java/org/opensearch/neuralsearch/processor/NeuralQueryEnricherProcessorTests.java +++ b/src/test/java/org/opensearch/neuralsearch/processor/NeuralQueryEnricherProcessorTests.java @@ -50,9 +50,11 @@ public void testProcessRequest_whenVisitingEmptyQueryBody_thenSuccess() throws E NeuralQueryEnricherProcessor.Factory factory = new NeuralQueryEnricherProcessor.Factory(); SearchRequest searchRequest = new SearchRequest(); searchRequest.source(new SearchSourceBuilder()); + assertNull(searchRequest.source().query()); NeuralQueryEnricherProcessor processor = createTestProcessor(factory); SearchRequest processSearchRequest = processor.processRequest(searchRequest); - assert (processSearchRequest == searchRequest); + // should do nothing + assertNull(processSearchRequest.source().query()); } public void testType() throws Exception {