diff --git a/warehouse/ingest-core/src/test/java/datawave/ingest/data/config/CachingFieldConfigHelperTest.java b/warehouse/ingest-core/src/test/java/datawave/ingest/data/config/CachingFieldConfigHelperTest.java index 48392823fb..f1d0deaa8f 100644 --- a/warehouse/ingest-core/src/test/java/datawave/ingest/data/config/CachingFieldConfigHelperTest.java +++ b/warehouse/ingest-core/src/test/java/datawave/ingest/data/config/CachingFieldConfigHelperTest.java @@ -6,9 +6,7 @@ import static org.mockito.Mockito.verify; import java.util.concurrent.atomic.AtomicLong; -import java.util.function.BiConsumer; import java.util.function.Function; -import java.util.stream.Stream; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -16,37 +14,29 @@ import org.junit.jupiter.params.provider.ValueSource; public class CachingFieldConfigHelperTest { - @SuppressWarnings("unchecked") @Test public void testCachingBehaviorWillCallBaseMethods() { - // @formatter:off - Stream.of(new Object[][] { - new Object[] { - (BiConsumer) FieldConfigHelper::isIndexOnlyField, - (BiConsumer) (h, f) -> verify(h).isIndexOnlyField(eq(f)), - (BiConsumer) FieldConfigHelper::isIndexedField, - (BiConsumer) (h, f) -> verify(h).isIndexedField(eq(f)), - (BiConsumer) FieldConfigHelper::isTokenizedField, - (BiConsumer) (h, f) -> verify(h).isTokenizedField(eq(f)), - (BiConsumer) FieldConfigHelper::isStoredField, - (BiConsumer) (h, f) -> verify(h).isStoredField(eq(f)), - (BiConsumer) FieldConfigHelper::isReverseIndexedField, - (BiConsumer) (h, f) -> verify(h).isReverseIndexedField(eq(f)), - (BiConsumer) FieldConfigHelper::isReverseTokenizedField, - (BiConsumer) (h, f) -> verify(h).isReverseTokenizedField(eq(f)), - } - }).forEach(arg -> { - // param[0] = helper method - // param[1] = validation method - String fieldName = "testField"; - BiConsumer testAction = (BiConsumer) arg[0]; - BiConsumer verifyAction = (BiConsumer) arg[1]; - FieldConfigHelper mockHelper = mock(FieldConfigHelper.class); - FieldConfigHelper cachedHelper = new CachedFieldConfigHelper(mockHelper, 1); - testAction.accept(cachedHelper, fieldName); - verifyAction.accept(mockHelper, fieldName); - }); - // @formatter:on + String fieldName = "test"; + FieldConfigHelper mockHelper = mock(FieldConfigHelper.class); + FieldConfigHelper cachedHelper = new CachedFieldConfigHelper(mockHelper, 1); + + cachedHelper.isIndexOnlyField(fieldName); + verify(mockHelper).isIndexOnlyField(eq(fieldName)); + + cachedHelper.isIndexedField(fieldName); + verify(mockHelper).isIndexedField(eq(fieldName)); + + cachedHelper.isTokenizedField(fieldName); + verify(mockHelper).isTokenizedField(eq(fieldName)); + + cachedHelper.isStoredField(fieldName); + verify(mockHelper).isStoredField(eq(fieldName)); + + cachedHelper.isReverseIndexedField(fieldName); + verify(mockHelper).isReverseIndexedField(eq(fieldName)); + + cachedHelper.isReverseTokenizedField(fieldName); + verify(mockHelper).isReverseTokenizedField(eq(fieldName)); } @ParameterizedTest