use of org.hisp.dhis.analytics.QueryKey.NV in project dhis2-core by dhis2.
the class EnrollmentAnalyticsManagerTest method verifyGetEnrollmentsWithOnlyMissingValueInFilter.
@Test
void verifyGetEnrollmentsWithOnlyMissingValueInFilter() {
String subSelect = "(select \"fWIAEtYVEGk\" from analytics_event_" + programA.getUid() + " where analytics_event_" + programA.getUid() + ".pi = ax.pi and \"fWIAEtYVEGk\" is not null and ps = '" + programStage.getUid() + "' order by executiondate desc limit 1 )";
String expected = subSelect + " is null";
String unexpected = "(" + subSelect + " in (";
testIt(IN, NV, ImmutableList.of((capturedSql) -> assertThat(capturedSql, containsString(expected)), (capturedSql) -> assertThat(capturedSql, not(containsString(unexpected)))));
}
use of org.hisp.dhis.analytics.QueryKey.NV in project dhis2-core by dhis2.
the class EventsAnalyticsManagerTest method verifyGetEventsWithMissingValueEqFilter.
@Test
void verifyGetEventsWithMissingValueEqFilter() {
String expected = "ax.\"fWIAEtYVEGk\" is null";
testIt(EQ, NV, Collections.singleton((capturedSql) -> assertThat(capturedSql, containsString(expected))));
}
use of org.hisp.dhis.analytics.QueryKey.NV in project dhis2-core by dhis2.
the class EventsAnalyticsManagerTest method verifyGetEventsWithOnlyMissingValueInFilter.
@Test
void verifyGetEventsWithOnlyMissingValueInFilter() {
String expected = "ax.\"fWIAEtYVEGk\" is null";
String unexpected = "(ax.\"fWIAEtYVEGk\" in (";
testIt(IN, NV, ImmutableList.of((capturedSql) -> assertThat(capturedSql, containsString(expected)), (capturedSql) -> assertThat(capturedSql, not(containsString(unexpected)))));
}
use of org.hisp.dhis.analytics.QueryKey.NV in project dhis2-core by dhis2.
the class EventsAnalyticsManagerTest method verifyGetEventsWithMissingValueNeFilter.
@Test
void verifyGetEventsWithMissingValueNeFilter() {
String expected = "ax.\"fWIAEtYVEGk\" is not null";
testIt(NE, NV, Collections.singleton((capturedSql) -> assertThat(capturedSql, containsString(expected))));
}
use of org.hisp.dhis.analytics.QueryKey.NV in project dhis2-core by dhis2.
the class EnrollmentAnalyticsManagerTest method verifyGetEnrollmentsWithMissingValueEqFilter.
@Test
void verifyGetEnrollmentsWithMissingValueEqFilter() {
String subSelect = "(select \"fWIAEtYVEGk\" from analytics_event_" + programA.getUid() + " where analytics_event_" + programA.getUid() + ".pi = ax.pi and \"fWIAEtYVEGk\" is not null and ps = '" + programStage.getUid() + "' order by executiondate desc limit 1 )";
String expected = subSelect + " is null";
testIt(EQ, NV, Collections.singleton((capturedSql) -> assertThat(capturedSql, containsString(expected))));
}
Aggregations