From 382d06d2b861d173ac37472fec564faa6715bf10 Mon Sep 17 00:00:00 2001 From: Yizhe Liu Date: Tue, 7 Jan 2025 22:43:14 -0800 Subject: [PATCH] Clean up unused validateFieldName() and use existing methods for TextEmbeddingProcessorIT Signed-off-by: Yizhe Liu --- .../util/ProcessorDocumentUtils.java | 24 ------------------- .../processor/TextEmbeddingProcessorIT.java | 9 ++----- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java b/src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java index 6f9297e5c..0cbf4534d 100644 --- a/src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java +++ b/src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java @@ -296,30 +296,6 @@ private static void unflattenSingleItem(String key, Object value, Map searchResponseAsMap = search(INDEX_NAME, queryNestedHighLevel, 2); assertNotNull(searchResponseAsMap); - Map hits = (Map) searchResponseAsMap.get("hits"); - assertNotNull(hits); - - List> listOfHits = (List>) hits.get("hits"); - assertNotNull(listOfHits); - assertEquals(1, listOfHits.size()); + assertEquals(1, getHitCount(searchResponseAsMap)); - Map innerHitDetails = listOfHits.getFirst(); + Map innerHitDetails = getFirstInnerHit(searchResponseAsMap); assertEquals("5", innerHitDetails.get("_id")); } finally { wipeOfTestResources(INDEX_NAME, PIPELINE_NAME, modelId, null);