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 4f5f0424389..b99b1473fb8 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 @@ -35,19 +35,7 @@ public class DocumentProjection implements DocumentPermutation { /** * should track document sizes */ - 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(); - } + private boolean trackSizes; public DocumentProjection(boolean includeGroupingContext, boolean reducedResponse, boolean trackSizes, Set projections, Projection.ProjectionType projectionType) { @@ -57,19 +45,6 @@ public DocumentProjection(boolean includeGroupingContext, boolean reducedRespons this.trackSizes = trackSizes; } - /* - * This contstructor will not include the grouping context and will not reduce the document - */ - @Deprecated - public DocumentProjection(Set projections, Projection.ProjectionType projectionType) { - this(false, false, projections, projectionType); - } - - @Deprecated - public DocumentProjection(boolean includeGroupingContext, boolean reducedResponse, Set projections, Projection.ProjectionType projectionType) { - this(includeGroupingContext, reducedResponse, true, projections, projectionType); - } - public DocumentProjection(boolean includeGroupingContext, boolean isReducedResponse, boolean isTrackSizes, Projection projection) { this.includeGroupingContext = includeGroupingContext; this.reducedResponse = isReducedResponse; @@ -77,16 +52,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/KeyProjection.java b/warehouse/query-core/src/main/java/datawave/query/predicate/KeyProjection.java index e1e7ea21a42..2b87b4d0c18 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 @@ -21,41 +21,6 @@ public KeyProjection(Set projections, Projection.ProjectionType projecti projection = new Projection(projections, projectionType); } - 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; - } - /* * (non-Javadoc) * 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 6c701e50546..dd7aed8b332 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,45 +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"); - } - - 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; @@ -66,6 +27,7 @@ public Projection(@Nonnull Set items, @Nonnull ProjectionType type) { this.initialized = true; this.type = type; if (type == ProjectionType.INCLUDES) { + // do not make a copy of the incoming include fields. It could be a UniversalSet this.projections = items; } else { this.projections = Sets.newHashSet(items); 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 14ca7c7aba4..d015e73e9d3 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 @@ -56,12 +56,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 +69,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 +89,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(11, result.getValue().size()); @@ -113,19 +106,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(11, 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 +125,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 +146,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 +165,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 +184,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 +204,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 +224,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 +245,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 +253,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 +267,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 +275,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 +289,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 +297,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 +311,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 8750f69c56f..ccd693f8966 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,50 +39,10 @@ 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); - - Iterator> iter = fiData.iterator(); - 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); - assertTrue(projection.getProjection().isUseIncludes()); - assertFalse(projection.getProjection().isUseExcludes()); - // test against field index data Iterator> iter = fiData.iterator(); assertTrue(projection.apply(iter.next())); // FIELD_A @@ -108,9 +68,6 @@ public void testIncludes() { public void testExcludes() { KeyProjection projection = new KeyProjection(Sets.newHashSet("FIELD_X", "FIELD_Y"), Projection.ProjectionType.EXCLUDES); - assertFalse(projection.getProjection().isUseIncludes()); - assertTrue(projection.getProjection().isUseExcludes()); - Iterator> iter = fiData.iterator(); assertTrue(projection.apply(iter.next())); // FIELD_A assertTrue(projection.apply(iter.next())); // FIELD_B @@ -131,14 +88,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")); - - assertTrue(projection.getProjection().isUseIncludes()); - assertFalse(projection.getProjection().isUseExcludes()); + KeyProjection projection = new KeyProjection(Sets.newHashSet("FIELD_A", "FIELD_B"), Projection.ProjectionType.INCLUDES); // test against field index data Iterator> iter = fiData.iterator(); @@ -161,14 +113,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")); - - assertFalse(projection.getProjection().isUseIncludes()); - assertTrue(projection.getProjection().isUseExcludes()); + public void testExcludesDeprecated() { + KeyProjection projection = new KeyProjection(Sets.newHashSet("FIELD_X", "FIELD_Y"), Projection.ProjectionType.EXCLUDES); Iterator> iter = fiData.iterator(); assertTrue(projection.apply(iter.next())); // FIELD_A 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 b0d6f3b038b..b094b924df5 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,9 @@ public class ProjectionTest { - @Deprecated - @Test(expected = RuntimeException.class) - public void testNoConfigurationDepricated() { - Projection projection = new Projection(); - assertTrue(projection.apply("FIELD_A")); - } - - @Test - 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 +38,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 +68,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 +98,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 +128,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")); }