From a609e634a348b76386fb11936bbe8c4b38ea72d0 Mon Sep 17 00:00:00 2001 From: Ralph Ursprung <39383228+rursprung@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:12:13 +0100 Subject: [PATCH] improve `PhoneNumberAnalyzerTests#testTelPrefixSearch` (#17016) this way we ensure that it doesn't include any additional tokens which we don't want. this is a follow-up to commit 4d943993ac9 / #16993. Signed-off-by: Ralph Ursprung --- .../opensearch/analysis/phone/PhoneNumberAnalyzerTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/analysis-phonenumber/src/test/java/org/opensearch/analysis/phone/PhoneNumberAnalyzerTests.java b/plugins/analysis-phonenumber/src/test/java/org/opensearch/analysis/phone/PhoneNumberAnalyzerTests.java index d55c0b2ce7d2a..503cee9cc710f 100644 --- a/plugins/analysis-phonenumber/src/test/java/org/opensearch/analysis/phone/PhoneNumberAnalyzerTests.java +++ b/plugins/analysis-phonenumber/src/test/java/org/opensearch/analysis/phone/PhoneNumberAnalyzerTests.java @@ -159,11 +159,11 @@ public void testSipWithoutDomainPart() throws IOException { } public void testTelPrefix() throws IOException { - assertTokensInclude("tel:+1228", Arrays.asList("1228", "122", "228")); + assertTokensInclude(phoneAnalyzer, "tel:+1228", Arrays.asList("tel:+1228", "tel:", "1228", "122", "228")); } public void testTelPrefixSearch() throws IOException { - assertTokensInclude("tel:+1228", Arrays.asList("1228")); + assertTokensAreInAnyOrder(phoneSearchAnalyzer, "tel:+1228", Arrays.asList("tel:+1228", "1228")); } public void testNumberPrefix() throws IOException {