diff --git a/warehouse/ingest-core/src/test/java/datawave/util/flag/IngestConfig.java b/warehouse/ingest-core/src/test/java/datawave/util/flag/IngestConfig.java index 930da10884..44661de643 100644 --- a/warehouse/ingest-core/src/test/java/datawave/util/flag/IngestConfig.java +++ b/warehouse/ingest-core/src/test/java/datawave/util/flag/IngestConfig.java @@ -70,8 +70,10 @@ static void create(final String fName) throws IOException { throw new IllegalArgumentException("configuration file does not exist (" + f.getAbsolutePath() + ")"); } + @SuppressWarnings("deprecation") final JsonParser parser = new JsonParser(); try (final Reader rdr = new FileReader(fName)) { + @SuppressWarnings("deprecation") final JsonElement json = parser.parse(rdr); final IngestConfig val = gson.fromJson(json.toString(), IngestConfig.class); cfg.set(val); diff --git a/warehouse/query-core/src/main/java/datawave/query/function/DocumentProjection.java b/warehouse/query-core/src/main/java/datawave/query/function/DocumentProjection.java index e676eb118b..80c7ac5d90 100644 --- a/warehouse/query-core/src/main/java/datawave/query/function/DocumentProjection.java +++ b/warehouse/query-core/src/main/java/datawave/query/function/DocumentProjection.java @@ -37,18 +37,6 @@ public class DocumentProjection implements DocumentPermutation { */ private boolean trackSizes = true; - @Deprecated - public DocumentProjection() { - this(false, false); - } - - @Deprecated - public DocumentProjection(boolean includeGroupingContext, boolean reducedResponse) { - this.includeGroupingContext = includeGroupingContext; - this.reducedResponse = reducedResponse; - this.projection = new Projection(); - } - public DocumentProjection(boolean includeGroupingContext, boolean reducedResponse, boolean trackSizes, Set projections, Projection.ProjectionType projectionType) { this.includeGroupingContext = includeGroupingContext; @@ -77,16 +65,6 @@ public DocumentProjection(boolean includeGroupingContext, boolean isReducedRespo this.projection = projection; } - @Deprecated - public void setIncludes(Set includes) { - this.projection.setIncludes(includes); - } - - @Deprecated - public void setExcludes(Set excludes) { - this.projection.setExcludes(excludes); - } - public Projection getProjection() { return projection; } diff --git a/warehouse/query-core/src/main/java/datawave/query/predicate/EventDataQueryFieldFilter.java b/warehouse/query-core/src/main/java/datawave/query/predicate/EventDataQueryFieldFilter.java index 29d19c50bc..2de74dbfb1 100644 --- a/warehouse/query-core/src/main/java/datawave/query/predicate/EventDataQueryFieldFilter.java +++ b/warehouse/query-core/src/main/java/datawave/query/predicate/EventDataQueryFieldFilter.java @@ -141,28 +141,4 @@ public EventDataQueryFilter clone() { return new EventDataQueryFieldFilter(this); } - /** - * Configure the delegate {@link Projection} with the fields to exclude - * - * @param excludes - * the set of fields to exclude - * @deprecated This method is deprecated and should no longer be used. - */ - @Deprecated - public void setExcludes(Set excludes) { - this.keyProjection.setExcludes(excludes); - } - - /** - * Set the delegate {@link Projection} with the fields to include - * - * @param includedFields - * the sorted set of fields to include - * @deprecated This method is deprecated and should no longer be used. - */ - @Deprecated - public void setIncludes(Set includedFields) { - this.keyProjection.setIncludes(includedFields); - } - } diff --git a/warehouse/query-core/src/main/java/datawave/query/predicate/KeyProjection.java b/warehouse/query-core/src/main/java/datawave/query/predicate/KeyProjection.java index e1e7ea21a4..8e8f2e2c38 100644 --- a/warehouse/query-core/src/main/java/datawave/query/predicate/KeyProjection.java +++ b/warehouse/query-core/src/main/java/datawave/query/predicate/KeyProjection.java @@ -25,32 +25,6 @@ public KeyProjection(KeyProjection other) { projection = other.getProjection(); } - @Deprecated - public KeyProjection() { - projection = new Projection(); - } - - /** - * Set the delegate {@link Projection} with the fields to include - * - * @param includes - * a set of fields to retain - */ - @Deprecated - public void setIncludes(Set includes) { - projection.setIncludes(includes); - } - - /** - * Set the delegate {@link Projection} with the fields to exclude - * - * @param excludes - * a set of fields to exclude - */ - public void setExcludes(Set excludes) { - projection.setExcludes(excludes); - } - @Deprecated public Projection getProjection() { return projection; diff --git a/warehouse/query-core/src/main/java/datawave/query/predicate/Projection.java b/warehouse/query-core/src/main/java/datawave/query/predicate/Projection.java index 576dbd8347..ad2717f51a 100644 --- a/warehouse/query-core/src/main/java/datawave/query/predicate/Projection.java +++ b/warehouse/query-core/src/main/java/datawave/query/predicate/Projection.java @@ -20,46 +20,6 @@ public final class Projection implements Predicate { private boolean initialized; - - @Deprecated - public void setIncludes(Set includes) { - if (this.initialized) { - throw new RuntimeException("This Projection instance was already initialized"); - } - - // do not make a copy of the incoming include fields. It could be a UniversalSet - this.projections = includes; - this.initialized = true; - type = ProjectionType.INCLUDES; - } - - @Deprecated - public void setExcludes(Set excludes) { - if (this.initialized) { - throw new RuntimeException("This Projection instance was already initialized"); - } - - this.projections = Sets.newHashSet(excludes); - this.initialized = true; - type = ProjectionType.EXCLUDES; - } - - @Deprecated - public Set getIncludes() { - return Collections.unmodifiableSet(this.projections); - } - - @Deprecated - public Set getExcludes() { - return Collections.unmodifiableSet(this.projections); - } - - /* Explicit constructor needed now that the new constructor was added */ - @Deprecated - public Projection() { - this.initialized = false; - } - private Set projections; private ProjectionType type; diff --git a/warehouse/query-core/src/test/java/datawave/query/function/DocumentProjectionTest.java b/warehouse/query-core/src/test/java/datawave/query/function/DocumentProjectionTest.java index b95188f640..306dce9221 100644 --- a/warehouse/query-core/src/test/java/datawave/query/function/DocumentProjectionTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/function/DocumentProjectionTest.java @@ -20,6 +20,7 @@ import datawave.query.attributes.Content; import datawave.query.attributes.Document; import datawave.query.attributes.Numeric; +import datawave.query.predicate.KeyProjection; import datawave.query.predicate.Projection; public class DocumentProjectionTest { @@ -56,12 +57,10 @@ public void setup() { d.put("OTHERS", others); // others' attributes have grouping context } - @Deprecated @Test public void testIncludesSingleFieldDeprecated() { Set includes = Sets.newHashSet("OTHERS"); - DocumentProjection projection = new DocumentProjection(); - projection.setIncludes(includes); + DocumentProjection projection = new DocumentProjection(false, false, true, includes, Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -71,19 +70,17 @@ public void testIncludesSingleFieldDeprecated() { @Test public void testIncludesSingleField() { Set includes = Sets.newHashSet("OTHERS"); - DocumentProjection projection = new DocumentProjection(includes, Projection.ProjectionType.INCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, includes, Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(4, result.getValue().size()); } - @Deprecated @Test public void testIncludesTwoFieldsDeprecated() { Set includes = Sets.newHashSet("FOO", "ID"); - DocumentProjection projection = new DocumentProjection(); - projection.setIncludes(includes); + DocumentProjection projection = new DocumentProjection(false, false, true, includes, Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -93,19 +90,16 @@ public void testIncludesTwoFieldsDeprecated() { @Test public void testIncludesTwoFields() { Set includes = Sets.newHashSet("FOO", "ID"); - DocumentProjection projection = new DocumentProjection(includes, Projection.ProjectionType.INCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, includes, Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(6, result.getValue().size()); } - @Deprecated @Test public void testIncludesNoFieldsSpecifiedDeprecated() { - DocumentProjection projection = new DocumentProjection(); - projection.setIncludes(Collections.emptySet()); - + DocumentProjection projection = new DocumentProjection(false, false, true, Collections.emptySet(), Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(0, result.getValue().size()); @@ -113,19 +107,16 @@ public void testIncludesNoFieldsSpecifiedDeprecated() { @Test public void testIncludesNoFieldsSpecified() { - DocumentProjection projection = new DocumentProjection(Collections.emptySet(), Projection.ProjectionType.INCLUDES); - + DocumentProjection projection = new DocumentProjection(false, false, true, Collections.emptySet(), Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(0, result.getValue().size()); } - @Deprecated @Test public void testIncludesAllFieldsDeprecated() { Set includes = Sets.newHashSet("FOO", "ID", "PRIMES", "PRIME", "CHILDREN"); - DocumentProjection projection = new DocumentProjection(); - projection.setIncludes(includes); + DocumentProjection projection = new DocumentProjection(false, false, true, includes, Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -135,20 +126,17 @@ public void testIncludesAllFieldsDeprecated() { @Test public void testIncludesAllFields() { Set includes = Sets.newHashSet("FOO", "ID", "PRIMES", "PRIME", "CHILDREN"); - DocumentProjection projection = new DocumentProjection(includes, Projection.ProjectionType.INCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, includes, Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(11, result.getValue().size()); } - @Deprecated @Test public void testIncludesAllFieldsExceptNestedDocumentFieldsDeprecated() { Set includes = Sets.newHashSet("FOO", "ID", "PRIME"); - DocumentProjection projection = new DocumentProjection(); - projection.setIncludes(includes); - + DocumentProjection projection = new DocumentProjection(false, false, true, includes, Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(11, result.getValue().size()); @@ -159,19 +147,16 @@ public void testIncludesAllFieldsExceptNestedDocumentFieldsDeprecated() { @Test public void testIncludesAllFieldsExceptNestedDocumentFields() { Set includes = Sets.newHashSet("FOO", "ID", "PRIME"); - DocumentProjection projection = new DocumentProjection(includes, Projection.ProjectionType.INCLUDES); - + DocumentProjection projection = new DocumentProjection(false, false, true, includes, Projection.ProjectionType.INCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(11, result.getValue().size()); } - @Deprecated @Test public void testExcludeSingleFieldDeprecated() { Set excludes = Sets.newHashSet("ID"); - DocumentProjection projection = new DocumentProjection(); - projection.setExcludes(excludes); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -181,19 +166,16 @@ public void testExcludeSingleFieldDeprecated() { @Test public void testExcludeSingleField() { Set excludes = Sets.newHashSet("ID"); - DocumentProjection projection = new DocumentProjection(excludes, Projection.ProjectionType.EXCLUDES); - + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(8, result.getValue().size()); } - @Deprecated @Test public void testExcludeChildDocumentFieldDeprecated() { Set excludes = Sets.newHashSet("CHILDREN"); - DocumentProjection projection = new DocumentProjection(); - projection.setExcludes(excludes); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -203,19 +185,17 @@ public void testExcludeChildDocumentFieldDeprecated() { @Test public void testExcludeChildDocumentField() { Set excludes = Sets.newHashSet("CHILDREN"); - DocumentProjection projection = new DocumentProjection(excludes, Projection.ProjectionType.EXCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(11, result.getValue().size()); } - @Deprecated @Test public void testExcludeAllFieldsDeprecated() { Set excludes = Sets.newHashSet("FOO", "ID", "PRIMES", "PRIME", "CHILDREN"); - DocumentProjection projection = new DocumentProjection(); - projection.setExcludes(excludes); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -225,19 +205,17 @@ public void testExcludeAllFieldsDeprecated() { @Test public void testExcludeAllFields() { Set excludes = Sets.newHashSet("FOO", "ID", "PRIMES", "PRIME", "CHILDREN"); - DocumentProjection projection = new DocumentProjection(excludes, Projection.ProjectionType.EXCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(0, result.getValue().size()); } - @Deprecated @Test public void testExcludeNestedFieldDeprecated() { Set excludes = Sets.newHashSet("PRIME"); - DocumentProjection projection = new DocumentProjection(); - projection.setExcludes(excludes); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -247,19 +225,17 @@ public void testExcludeNestedFieldDeprecated() { @Test public void testExcludeNestedField() { Set excludes = Sets.newHashSet("PRIME"); - DocumentProjection projection = new DocumentProjection(excludes, Projection.ProjectionType.EXCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); assertEquals(6, result.getValue().size()); } - @Deprecated @Test public void testConfirmFieldExcludedDeprecated() { Set excludes = Sets.newHashSet("PRIMES"); - DocumentProjection projection = new DocumentProjection(); - projection.setExcludes(excludes); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -270,7 +246,7 @@ public void testConfirmFieldExcludedDeprecated() { @Test public void testConfirmFieldExcluded() { Set excludes = Sets.newHashSet("PRIMES"); - DocumentProjection projection = new DocumentProjection(excludes, Projection.ProjectionType.EXCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -278,12 +254,10 @@ public void testConfirmFieldExcluded() { assertFalse(result.getValue().containsKey("PRIMES")); // key no longer exists } - @Deprecated @Test public void testConfirmGroupingContextDeprecated() { Set excludes = Sets.newHashSet("FOO"); - DocumentProjection projection = new DocumentProjection(); - projection.setExcludes(excludes); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -294,7 +268,7 @@ public void testConfirmGroupingContextDeprecated() { @Test public void testConfirmGroupingContext() { Set excludes = Sets.newHashSet("FOO"); - DocumentProjection projection = new DocumentProjection(excludes, Projection.ProjectionType.EXCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, excludes, Projection.ProjectionType.EXCLUDES); assertEquals(11, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -302,13 +276,10 @@ public void testConfirmGroupingContext() { assertFalse(result.getValue().containsKey("FOO")); // key no longer exists } - @Deprecated @Test public void testIncludesExampleCaseDepricated() { Document d = buildExampleDocument(); - - DocumentProjection projection = new DocumentProjection(); - projection.setIncludes(Collections.singleton("NAME")); + DocumentProjection projection = new DocumentProjection(false, false, true, Sets.newHashSet("NAME"), Projection.ProjectionType.INCLUDES); assertEquals(6, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -319,8 +290,7 @@ public void testIncludesExampleCaseDepricated() { @Test public void testIncludesExampleCase() { Document d = buildExampleDocument(); - - DocumentProjection projection = new DocumentProjection(Collections.singleton("NAME"), Projection.ProjectionType.INCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, Sets.newHashSet("NAME"), Projection.ProjectionType.INCLUDES); assertEquals(6, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -328,13 +298,10 @@ public void testIncludesExampleCase() { assertTrue(result.getValue().containsKey("NAME")); } - @Deprecated @Test public void testExcludesExampleCaseDeprecated() { Document d = buildExampleDocument(); - - DocumentProjection projection = new DocumentProjection(); - projection.setExcludes(Collections.singleton("NAME")); + DocumentProjection projection = new DocumentProjection(false, false, true, Sets.newHashSet("NAME"), Projection.ProjectionType.EXCLUDES); assertEquals(6, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); @@ -345,8 +312,7 @@ public void testExcludesExampleCaseDeprecated() { @Test public void testExcludesExampleCase() { Document d = buildExampleDocument(); - - DocumentProjection projection = new DocumentProjection(Collections.singleton("NAME"), Projection.ProjectionType.EXCLUDES); + DocumentProjection projection = new DocumentProjection(false, false, true, Sets.newHashSet("NAME"), Projection.ProjectionType.EXCLUDES); assertEquals(6, d.size()); Map.Entry result = projection.apply(Maps.immutableEntry(new Key(), d)); diff --git a/warehouse/query-core/src/test/java/datawave/query/predicate/KeyProjectionTest.java b/warehouse/query-core/src/test/java/datawave/query/predicate/KeyProjectionTest.java index 8750f69c56..8976e53911 100644 --- a/warehouse/query-core/src/test/java/datawave/query/predicate/KeyProjectionTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/predicate/KeyProjectionTest.java @@ -39,15 +39,6 @@ public void setup() { eventData.add(Maps.immutableEntry(new Key("20200314_1", "datatype\0uid", "FIELD_Z\0value_z"), "data")); } - @Deprecated - @Test(expected = RuntimeException.class) - public void testNoConfigurationDeprecated() { - KeyProjection projection = new KeyProjection(); - - Iterator> iter = fiData.iterator(); - assertTrue(projection.apply(iter.next())); - } - @Test(expected = RuntimeException.class) public void testNoConfiguration() { KeyProjection projection = new KeyProjection(null); @@ -56,26 +47,6 @@ public void testNoConfiguration() { assertTrue(projection.apply(iter.next())); } - @Test(expected = RuntimeException.class) - public void testTooMuchConfiguration() { - KeyProjection projection = new KeyProjection(); - projection.setIncludes(Sets.newHashSet("FIELD_A", "FIELD_B")); - projection.setExcludes(Sets.newHashSet("FIELD_X", "FIELD_Y")); - - Iterator> iter = fiData.iterator(); - assertTrue(projection.apply(iter.next())); - } - - @Test(expected = RuntimeException.class) - public void testTooMuchOfTheSameConfiguration() { - KeyProjection projection = new KeyProjection(); - projection.setExcludes(Sets.newHashSet("FIELD_X", "FIELD_Y")); - projection.setExcludes(Sets.newHashSet("FIELD_X", "FIELD_Y")); - - Iterator> iter = fiData.iterator(); - assertTrue(projection.apply(iter.next())); - } - @Test public void testIncludes() { KeyProjection projection = new KeyProjection(Sets.newHashSet("FIELD_A", "FIELD_B"), Projection.ProjectionType.INCLUDES); @@ -131,11 +102,9 @@ public void testExcludes() { assertTrue(projection.apply(iter.next())); // FIELD_Z } - @Deprecated @Test public void testIncludesDeprecated() { - KeyProjection projection = new KeyProjection(); - projection.setIncludes(Sets.newHashSet("FIELD_A", "FIELD_B")); + KeyProjection projection = new KeyProjection(Sets.newHashSet("FIELD_A", "FIELD_B"), Projection.ProjectionType.INCLUDES); assertTrue(projection.getProjection().isUseIncludes()); assertFalse(projection.getProjection().isUseExcludes()); @@ -161,11 +130,9 @@ public void testIncludesDeprecated() { assertFalse(projection.apply(iter.next())); // FIELD_Z } - @Deprecated @Test - public void testExcludesDepricated() { - KeyProjection projection = new KeyProjection(); - projection.setExcludes(Sets.newHashSet("FIELD_X", "FIELD_Y")); + public void testExcludesDeprecated() { + KeyProjection projection = new KeyProjection(Sets.newHashSet("FIELD_X", "FIELD_Y"), Projection.ProjectionType.EXCLUDES); assertFalse(projection.getProjection().isUseIncludes()); assertTrue(projection.getProjection().isUseExcludes()); diff --git a/warehouse/query-core/src/test/java/datawave/query/predicate/ProjectionTest.java b/warehouse/query-core/src/test/java/datawave/query/predicate/ProjectionTest.java index d67c7ec36d..201e64e149 100644 --- a/warehouse/query-core/src/test/java/datawave/query/predicate/ProjectionTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/predicate/ProjectionTest.java @@ -9,43 +9,15 @@ public class ProjectionTest { - @Deprecated - @Test(expected = RuntimeException.class) - public void testNoConfigurationDepricated() { - Projection projection = new Projection(); - assertTrue(projection.apply("FIELD_A")); - } - @Test(expected = RuntimeException.class) public void testNoConfiguration() { Projection projection = new Projection(null, Projection.ProjectionType.INCLUDES); assertTrue(projection.apply("FIELD_A")); } - @Deprecated - @Test(expected = RuntimeException.class) - public void testTooMuchConfiguration() { - Projection projection = new Projection(); - projection.setIncludes(Sets.newHashSet("FIELD_A", "FIELD_B")); - projection.setExcludes(Sets.newHashSet("FIELD_X", "FIELD_Y")); - assertTrue(projection.apply("FIELD_A")); - } - - @Deprecated - @Test(expected = RuntimeException.class) - public void testTooMuchOfTheSameConfiguration() { - Projection projection = new Projection(); - projection.setIncludes(Sets.newHashSet("FIELD_A", "FIELD_B")); - projection.setIncludes(Sets.newHashSet("FIELD_A", "FIELD_B")); - assertTrue(projection.apply("FIELD_A")); - } - - @Deprecated @Test public void testIncludesDepricated() { - Projection projection = new Projection(); - projection.setIncludes(Sets.newHashSet("FIELD_A", "FIELD_B")); - + Projection projection = new Projection(Sets.newHashSet("FIELD_A", "FIELD_B"), Projection.ProjectionType.INCLUDES); assertTrue(projection.isUseIncludes()); assertFalse(projection.isUseExcludes()); @@ -72,11 +44,9 @@ public void testIncludes() { assertFalse(projection.apply("FIELD_Z")); } - @Deprecated @Test public void testIncludesWithGroupingContextDeprecated() { - Projection projection = new Projection(); - projection.setIncludes(Sets.newHashSet("FIELD_A", "FIELD_B")); + Projection projection = new Projection(Sets.newHashSet("FIELD_A", "FIELD_B"), Projection.ProjectionType.INCLUDES); assertTrue(projection.isUseIncludes()); assertFalse(projection.isUseExcludes()); @@ -104,11 +74,9 @@ public void testIncludesWithGroupingContext() { assertFalse(projection.apply("FIELD_Z")); } - @Deprecated @Test public void testExcludesDeprecated() { - Projection projection = new Projection(); - projection.setExcludes(Sets.newHashSet("FIELD_X", "FIELD_Y")); + Projection projection = new Projection(Sets.newHashSet("FIELD_X", "FIELD_Y"), Projection.ProjectionType.EXCLUDES); assertFalse(projection.isUseIncludes()); assertTrue(projection.isUseExcludes()); @@ -136,11 +104,9 @@ public void testExcludes() { assertTrue(projection.apply("FIELD_Z")); } - @Deprecated @Test public void testExcludesWithGroupingContextDeprecated() { - Projection projection = new Projection(); - projection.setExcludes(Sets.newHashSet("FIELD_X", "FIELD_Y")); + Projection projection = new Projection(Sets.newHashSet("FIELD_X", "FIELD_Y"), Projection.ProjectionType.EXCLUDES); assertFalse(projection.isUseIncludes()); assertTrue(projection.isUseExcludes()); @@ -168,11 +134,9 @@ public void testExcludesWithGroupingContext() { assertTrue(projection.apply("FIELD_Z")); } - @Deprecated @Test public void testTheAbsurdDeprecated() { - Projection projection = new Projection(); - projection.setIncludes(Sets.newHashSet("PREFIX")); + Projection projection = new Projection(Sets.newHashSet("PREFIX"), Projection.ProjectionType.INCLUDES); assertTrue(projection.apply("$PREFIX.SUFFIX01.SUFFIX.02")); }