From 956a89a4bc2057b4f13ee424d27f62c4bdb6fc4a Mon Sep 17 00:00:00 2001 From: Krishna Kondaka Date: Fri, 13 Dec 2024 16:13:25 -0800 Subject: [PATCH] Fix failing data-prepper-expression code coverage verfication (#5265) Signed-off-by: Krishna Kondaka --- .../org/opensearch/dataprepper/expression/AndOperatorTest.java | 1 + .../org/opensearch/dataprepper/expression/EqualOperatorTest.java | 1 + .../dataprepper/expression/GenericNotOperatorTest.java | 1 + .../dataprepper/expression/GreaterThanOperatorTest.java | 1 + .../dataprepper/expression/GreaterThanOrEqualOperatorTest.java | 1 + .../opensearch/dataprepper/expression/LessThanOperatorTest.java | 1 + .../dataprepper/expression/LessThanOrEqualOperatorTest.java | 1 + .../opensearch/dataprepper/expression/NotInSetOperatorTest.java | 1 + .../org/opensearch/dataprepper/expression/NotOperatorTest.java | 1 + .../org/opensearch/dataprepper/expression/OrOperatorTest.java | 1 + .../dataprepper/expression/RegexEqualOperatorTest.java | 1 + .../dataprepper/expression/RegexNotEqualOperatorTest.java | 1 + .../opensearch/dataprepper/expression/TypeOfOperatorTest.java | 1 + 13 files changed, 13 insertions(+) diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/AndOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/AndOperatorTest.java index 0437b794ce..a6a526e669 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/AndOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/AndOperatorTest.java @@ -35,6 +35,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/EqualOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/EqualOperatorTest.java index a5fe621ff2..5f9f8caf19 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/EqualOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/EqualOperatorTest.java @@ -36,6 +36,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GenericNotOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GenericNotOperatorTest.java index c75b446a6c..cb0d55a817 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GenericNotOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GenericNotOperatorTest.java @@ -68,6 +68,7 @@ void testGivenMatchingRuleThenReturnTrue() { .getRuleIndex(); assertThat(genericNotOperator.shouldEvaluate(context), is(true)); + assertThat(genericNotOperator.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GreaterThanOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GreaterThanOperatorTest.java index dbf8023760..0f29e98ac2 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GreaterThanOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GreaterThanOperatorTest.java @@ -35,6 +35,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GreaterThanOrEqualOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GreaterThanOrEqualOperatorTest.java index 55c41b0ca9..8e434ea7de 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GreaterThanOrEqualOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/GreaterThanOrEqualOperatorTest.java @@ -35,6 +35,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/LessThanOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/LessThanOperatorTest.java index 7434161533..e87ac6aa4f 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/LessThanOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/LessThanOperatorTest.java @@ -35,6 +35,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/LessThanOrEqualOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/LessThanOrEqualOperatorTest.java index 94b52961a8..7a41ac66ea 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/LessThanOrEqualOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/LessThanOrEqualOperatorTest.java @@ -35,6 +35,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/NotInSetOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/NotInSetOperatorTest.java index 40ef722bdb..3cc4e4f159 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/NotInSetOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/NotInSetOperatorTest.java @@ -38,6 +38,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/NotOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/NotOperatorTest.java index 29fa4c8c3f..bcef789a5e 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/NotOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/NotOperatorTest.java @@ -35,6 +35,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/OrOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/OrOperatorTest.java index 452939f6cc..b1dc2c293a 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/OrOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/OrOperatorTest.java @@ -35,6 +35,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/RegexEqualOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/RegexEqualOperatorTest.java index bb92cd1e49..894eaa4638 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/RegexEqualOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/RegexEqualOperatorTest.java @@ -36,6 +36,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/RegexNotEqualOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/RegexNotEqualOperatorTest.java index 30bc199413..052576a6d1 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/RegexNotEqualOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/RegexNotEqualOperatorTest.java @@ -36,6 +36,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test diff --git a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/TypeOfOperatorTest.java b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/TypeOfOperatorTest.java index e7a0acb6f1..fa659b26ea 100644 --- a/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/TypeOfOperatorTest.java +++ b/data-prepper-expression/src/test/java/org/opensearch/dataprepper/expression/TypeOfOperatorTest.java @@ -44,6 +44,7 @@ void testShouldEvaluate() { assertThat(objectUnderTest.shouldEvaluate(ctx), is(true)); when(ctx.getRuleIndex()).thenReturn(-1); assertThat(objectUnderTest.shouldEvaluate(ctx), is(false)); + assertThat(objectUnderTest.isBooleanOperator(), is(true)); } @Test