use of org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder in project dhis2-core by dhis2.
the class ProgramSqlGeneratorItemsTest method setUp.
@BeforeEach
public void setUp() {
dataElementA = createDataElement('A');
dataElementA.setDomainType(DataElementDomain.TRACKER);
dataElementA.setUid("DataElmentA");
attributeA = createTrackedEntityAttribute('A', ValueType.NUMBER);
attributeA.setUid("Attribute0A");
constantA = new Constant("Constant A", 123.456);
constantA.setUid("constant00A");
constantMap = new ImmutableMap.Builder<String, Constant>().put("constant00A", new Constant("constant", 123.456)).build();
OrganisationUnit organisationUnit = createOrganisationUnit('A');
programStageA = new ProgramStage("StageA", programA);
programStageA.setSortOrder(1);
programStageA.setUid("ProgrmStagA");
programA = createProgram('A', new HashSet<>(), organisationUnit);
programA.setUid("Program000A");
statementBuilder = new PostgreSQLStatementBuilder();
programIndicator = new ProgramIndicator();
programIndicator.setProgram(programA);
programIndicator.setAnalyticsType(AnalyticsType.EVENT);
}
use of org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder in project dhis2-core by dhis2.
the class JdbcEventStoreTest method setUp.
@BeforeEach
public void setUp() {
when(jdbcTemplate.queryForRowSet(anyString())).thenReturn(this.rowSet);
when(jdbcTemplate.getDataSource()).thenReturn(mock(DataSource.class));
ObjectMapper objectMapper = new ObjectMapper();
subject = new JdbcEventStore(new PostgreSQLStatementBuilder(), jdbcTemplate, objectMapper, currentUserService, manager, env, eventStore, skipLockedProvider);
}
use of org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder in project dhis2-core by dhis2.
the class JdbcEventAnalyticsTableManagerTest method setUp.
@BeforeEach
public void setUp() {
statementBuilder = new PostgreSQLStatementBuilder();
today = Date.from(LocalDate.of(2019, 7, 6).atStartOfDay(ZoneId.systemDefault()).toInstant());
subject = new JdbcEventAnalyticsTableManager(idObjectManager, organisationUnitService, categoryService, systemSettingManager, mock(DataApprovalLevelService.class), mock(ResourceTableService.class), mock(AnalyticsTableHookService.class), statementBuilder, mock(PartitionManager.class), databaseInfo, jdbcTemplate);
}
use of org.hisp.dhis.jdbc.statementbuilder.PostgreSQLStatementBuilder in project dhis2-core by dhis2.
the class EventsAnalyticsManagerTest method setUp.
@BeforeEach
public void setUp() {
StatementBuilder statementBuilder = new PostgreSQLStatementBuilder();
EventTimeFieldSqlRenderer timeCoordinateSelector = new EventTimeFieldSqlRenderer(statementBuilder);
ProgramIndicatorService programIndicatorService = mock(ProgramIndicatorService.class);
DefaultProgramIndicatorSubqueryBuilder programIndicatorSubqueryBuilder = new DefaultProgramIndicatorSubqueryBuilder(programIndicatorService);
subject = new JdbcEventAnalyticsManager(jdbcTemplate, statementBuilder, programIndicatorService, programIndicatorSubqueryBuilder, timeCoordinateSelector, executionPlanStore);
when(jdbcTemplate.queryForRowSet(anyString())).thenReturn(this.rowSet);
}
Aggregations