Skip to content

Commit

Permalink
#38: implemented disable / enable capabilities in Capabilities.Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiiaSergienko committed Mar 12, 2019
1 parent 7131402 commit ac8bc74
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import org.junit.jupiter.api.Test;

import static com.exasol.adapter.capabilities.CapabilityAssertions.*;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.junit.jupiter.api.Assertions.assertAll;

class CapabilitiesTest {
Expand Down Expand Up @@ -115,22 +115,13 @@ void substractCapabilities() {
final Capabilities capabilitiesWithExclusion = capabilities.subtractCapabilities(capabilitiesToExclude);
assertAll(() -> assertThat(capabilitiesWithExclusion.getMainCapabilities(),
contains(MainCapability.AGGREGATE_GROUP_BY_EXPRESSION)),
() -> assertThat(capabilitiesWithExclusion.getMainCapabilities(),
not(contains(MainCapability.AGGREGATE_GROUP_BY_COLUMN))),
() -> assertThat(capabilitiesWithExclusion.getLiteralCapabilities(), contains(LiteralCapability.DOUBLE)),
() -> assertThat(capabilitiesWithExclusion.getLiteralCapabilities(),
not(contains(LiteralCapability.DATE))),
containsInAnyOrder(LiteralCapability.DOUBLE)),
() -> assertThat(capabilitiesWithExclusion.getPredicateCapabilities(),
contains(PredicateCapability.BETWEEN)),
() -> assertThat(capabilitiesWithExclusion.getPredicateCapabilities(),
not(contains(PredicateCapability.EQUAL))),
() -> assertThat(capabilitiesWithExclusion.getScalarFunctionCapabilities(),
contains(ScalarFunctionCapability.ABS)),
containsInAnyOrder(PredicateCapability.BETWEEN)),
() -> assertThat(capabilitiesWithExclusion.getScalarFunctionCapabilities(),
not(contains(ScalarFunctionCapability.ADD))),
() -> assertThat(capabilitiesWithExclusion.getAggregateFunctionCapabilities(),
contains(AggregateFunctionCapability.AVG)),
containsInAnyOrder(ScalarFunctionCapability.ABS)),
() -> assertThat(capabilitiesWithExclusion.getAggregateFunctionCapabilities(),
not(contains(AggregateFunctionCapability.APPROXIMATE_COUNT_DISTINCT))));
containsInAnyOrder(AggregateFunctionCapability.AVG)));
}
}

0 comments on commit ac8bc74

Please sign in to comment.