diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTableUpdateParams.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTableUpdateParams.java index ddb0daed7301..1dd90d192c58 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTableUpdateParams.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTableUpdateParams.java @@ -27,8 +27,6 @@ */ package org.hisp.dhis.analytics; -import static com.google.common.base.Preconditions.checkNotNull; - import com.google.common.base.MoreObjects; import java.util.Date; import java.util.HashMap; @@ -36,6 +34,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import lombok.Builder; import lombok.Getter; import org.hisp.dhis.analytics.table.model.AnalyticsTablePartition; import org.hisp.dhis.calendar.Calendar; @@ -50,38 +49,40 @@ * @author Lars Helge Overland */ @Getter +@Builder(toBuilder = true, builderMethodName = "newBuilder") public class AnalyticsTableUpdateParams { /** * Number of last years for which to update tables. A zero value indicates the "latest" data * stored since last full analytics table generation. */ - private Integer lastYears; + private final Integer lastYears; /** Indicates whether to skip update of resource tables. */ - private boolean skipResourceTables; + private final boolean skipResourceTables; /** Indicates whether to skip update of analytics tables, outliers stats columns. */ - private boolean skipOutliers; + private final boolean skipOutliers; /** Analytics table types to skip. */ - private Set skipTableTypes = new HashSet<>(); + @Builder.Default private final Set skipTableTypes = new HashSet<>(); /** Analytics table programs to skip. */ - private Set skipPrograms = new HashSet<>(); + @Builder.Default private final Set skipPrograms = new HashSet<>(); /** Job ID. */ - private JobConfiguration jobId; + private final JobConfiguration jobId; /** Start time for update process. */ - private Date startTime; + @Builder.Default private final Date startTime = new Date(); /** Time of last successful analytics table update. */ - private Date lastSuccessfulUpdate; + private final Date lastSuccessfulUpdate; /** Current date, only used for testing */ - private Date today; + private final Date today; - private final Map extraParameters = new HashMap<>(); + /** free key-value map for extra parameters. */ + @Builder.Default private final Map extraParameters = new HashMap<>(); public void addExtraParam(String prefix, String key, Object value) { extraParameters.put(prefix + key, value); @@ -91,10 +92,6 @@ public Object getExtraParam(String prefix, String key) { return extraParameters.get(prefix + key); } - private AnalyticsTableUpdateParams() { - this.startTime = new Date(); - } - // ------------------------------------------------------------------------- // Get methods // ------------------------------------------------------------------------- @@ -155,105 +152,7 @@ public Date getFromDate() { return earliest; } - // ------------------------------------------------------------------------- - // Builder of immutable instances - // ------------------------------------------------------------------------- - - /** Returns a new instance of this parameter object. */ - public AnalyticsTableUpdateParams instance() { - AnalyticsTableUpdateParams params = new AnalyticsTableUpdateParams(); - - params.lastYears = this.lastYears; - params.skipResourceTables = this.skipResourceTables; - params.skipOutliers = this.skipOutliers; - params.skipTableTypes = new HashSet<>(this.skipTableTypes); - params.skipPrograms = new HashSet<>(this.skipPrograms); - params.jobId = this.jobId; - params.startTime = this.startTime; - params.lastSuccessfulUpdate = this.lastSuccessfulUpdate; - - return this; - } - - public static Builder newBuilder() { - return new AnalyticsTableUpdateParams.Builder(); - } - - public static Builder newBuilder(AnalyticsTableUpdateParams analyticsTableUpdateParams) { - return new AnalyticsTableUpdateParams.Builder(analyticsTableUpdateParams); - } - - /** Builder for {@link AnalyticsTableUpdateParams} instances. */ - public static class Builder { - private final AnalyticsTableUpdateParams params; - - protected Builder() { - this.params = new AnalyticsTableUpdateParams(); - } - - protected Builder(AnalyticsTableUpdateParams analyticsTableUpdateParams) { - this.params = analyticsTableUpdateParams.instance(); - } - - public Builder withLastYears(Integer lastYears) { - this.params.lastYears = lastYears; - return this; - } - - public Builder withLatestPartition() { - this.params.lastYears = AnalyticsTablePartition.LATEST_PARTITION; - return this; - } - - public Builder withSkipResourceTables(boolean skipResourceTables) { - this.params.skipResourceTables = skipResourceTables; - return this; - } - - public Builder withSkipOutliers(boolean skipOutliers) { - this.params.skipOutliers = skipOutliers; - return this; - } - - public Builder withSkipTableTypes(Set skipTableTypes) { - this.params.skipTableTypes = skipTableTypes; - return this; - } - - public Builder withSkipPrograms(Set skipPrograms) { - this.params.skipPrograms = skipPrograms; - return this; - } - - public Builder withJobId(JobConfiguration jobId) { - this.params.jobId = jobId; - return this; - } - - public Builder withLastSuccessfulUpdate(Date lastSuccessfulUpdate) { - this.params.lastSuccessfulUpdate = lastSuccessfulUpdate; - return this; - } - - public Builder withStartTime(Date startTime) { - this.params.startTime = startTime; - return this; - } - - /** - * This builder property is only used for testing purposes. - * - * @param date A mock Date - */ - public Builder withToday(Date date) { - - this.params.today = date; - return this; - } - - public AnalyticsTableUpdateParams build() { - checkNotNull(this.params.startTime); - return this.params; - } + public AnalyticsTableUpdateParams withLatestPartition() { + return this.toBuilder().lastYears(AnalyticsTablePartition.LATEST_PARTITION).build(); } } diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableGenerator.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableGenerator.java index bc9ad79bf048..bea7af23b130 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableGenerator.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableGenerator.java @@ -84,9 +84,7 @@ public void generateAnalyticsTables(AnalyticsTableUpdateParams params0, JobProgr .collect(Collectors.toSet()); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder(params0) - .withLastSuccessfulUpdate(lastSuccessfulUpdate) - .build(); + params0.toBuilder().lastSuccessfulUpdate(lastSuccessfulUpdate).build(); log.info("Found {} analytics table types: {}", availableTypes.size(), availableTypes); log.info("Analytics table update: {}", params); diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/AnalyticsTableJob.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/AnalyticsTableJob.java index ff6453160a03..820466d00333 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/AnalyticsTableJob.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/AnalyticsTableJob.java @@ -58,13 +58,13 @@ public void execute(JobConfiguration jobConfiguration, JobProgress progress) { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(parameters.getLastYears()) - .withSkipResourceTables(parameters.isSkipResourceTables()) - .withSkipOutliers(parameters.isSkipOutliers()) - .withSkipTableTypes(parameters.getSkipTableTypes()) - .withSkipPrograms(parameters.getSkipPrograms()) - .withJobId(jobConfiguration) - .withStartTime(new Date()) + .lastYears(parameters.getLastYears()) + .skipResourceTables(parameters.isSkipResourceTables()) + .skipOutliers(parameters.isSkipOutliers()) + .skipTableTypes(parameters.getSkipTableTypes()) + .skipPrograms(parameters.getSkipPrograms()) + .jobId(jobConfiguration) + .startTime(new Date()) .build(); analyticsTableGenerator.generateAnalyticsTables(params, progress); diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/ContinuousAnalyticsTableJob.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/ContinuousAnalyticsTableJob.java index 21d2139359ff..a3ebad9f3306 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/ContinuousAnalyticsTableJob.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/ContinuousAnalyticsTableJob.java @@ -99,12 +99,12 @@ public void execute(JobConfiguration jobConfiguration, JobProgress progress) { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(parameters.getLastYears()) - .withSkipResourceTables(false) - .withSkipOutliers(parameters.getSkipOutliers()) - .withSkipTableTypes(parameters.getSkipTableTypes()) - .withJobId(jobConfiguration) - .withStartTime(startTime) + .lastYears(parameters.getLastYears()) + .skipResourceTables(false) + .skipOutliers(parameters.getSkipOutliers()) + .skipTableTypes(parameters.getSkipTableTypes()) + .jobId(jobConfiguration) + .startTime(startTime) .build(); try { @@ -119,13 +119,13 @@ public void execute(JobConfiguration jobConfiguration, JobProgress progress) { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLatestPartition() - .withSkipResourceTables(true) - .withSkipOutliers(parameters.getSkipOutliers()) - .withSkipTableTypes(parameters.getSkipTableTypes()) - .withJobId(jobConfiguration) - .withStartTime(startTime) - .build(); + .skipResourceTables(true) + .skipOutliers(parameters.getSkipOutliers()) + .skipTableTypes(parameters.getSkipTableTypes()) + .jobId(jobConfiguration) + .startTime(startTime) + .build() + .withLatestPartition(); analyticsTableGenerator.generateAnalyticsTables(params, progress); } diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManagerTest.java b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManagerTest.java index 9b99bc79ee08..0edb4038355d 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManagerTest.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManagerTest.java @@ -124,7 +124,7 @@ void testGetRegularAnalyticsTable() { List dataYears = List.of(2018, 2019); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder().withStartTime(startTime).build(); + AnalyticsTableUpdateParams.newBuilder().startTime(startTime).build(); when(analyticsTableSettings.getTableLogged()).thenReturn(UNLOGGED); when(jdbcTemplate.queryForList(Mockito.anyString(), ArgumentMatchers.>any())) @@ -165,7 +165,7 @@ void testGetRegularAnalyticsTableLogged() { List dataYears = List.of(2018, 2019); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder().withStartTime(startTime).build(); + AnalyticsTableUpdateParams.newBuilder().startTime(startTime).build(); when(analyticsTableSettings.getTableLogged()).thenReturn(LOGGED); when(jdbcTemplate.queryForList(Mockito.anyString(), ArgumentMatchers.>any())) @@ -206,10 +206,7 @@ void testGetLatestAnalyticsTable() { Date startTime = new DateTime(2019, 3, 1, 10, 0).toDate(); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder() - .withStartTime(startTime) - .withLatestPartition() - .build(); + AnalyticsTableUpdateParams.newBuilder().startTime(startTime).build().withLatestPartition(); List> queryResp = new ArrayList<>(); queryResp.add(Map.of("dataelementid", 1)); @@ -245,10 +242,7 @@ void testGetLatestAnalyticsTableNoFullTableUpdate() { Date startTime = new DateTime(2019, 3, 1, 10, 0).toDate(); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder() - .withStartTime(startTime) - .withLatestPartition() - .build(); + AnalyticsTableUpdateParams.newBuilder().startTime(startTime).build().withLatestPartition(); when(settings.getLastSuccessfulResourceTablesUpdate()).thenReturn(new Date(0L)); when(settings.getLastSuccessfulAnalyticsTablesUpdate()).thenReturn(new Date(42L)); @@ -275,10 +269,8 @@ void testSwapTable() { LOGGED); table.addTablePartition(List.of(), 2023, new DateTime(2023, 1, 1, 0, 0).toDate(), null); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder() - .withStartTime(startTime) - .withLatestPartition() - .build(); + AnalyticsTableUpdateParams.newBuilder().startTime(startTime).build().withLatestPartition(); + when(jdbcTemplate.queryForList(any())).thenReturn(List.of(Map.of("table_name", "analytic"))); Table swappedPartition = table.getTablePartitions().get(0).swapFromStaging(); diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcEnrollmentAnalyticsTableManagerTest.java b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcEnrollmentAnalyticsTableManagerTest.java index c380f55bf54a..e5caed47ad7c 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcEnrollmentAnalyticsTableManagerTest.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcEnrollmentAnalyticsTableManagerTest.java @@ -135,7 +135,7 @@ void verifyTeiTypeOrgUnitFetchesOuUidWhenPopulatingEventAnalyticsTable() { when(idObjectManager.getAllNoAcl(Program.class)).thenReturn(List.of(p1)); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder().withLastYears(2).withStartTime(START_TIME).build(); + AnalyticsTableUpdateParams.newBuilder().lastYears(2).startTime(START_TIME).build(); List analyticsTables = subject.getAnalyticsTables(params); assertFalse(analyticsTables.isEmpty()); diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManagerTest.java b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManagerTest.java index 7c8774b7dfe4..85e9d37bb7bf 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManagerTest.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManagerTest.java @@ -216,10 +216,10 @@ void verifyGetLatestAnalyticsTables() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withStartTime(startTime) - .withLatestPartition() - .withSkipPrograms(skipPrograms) - .build(); + .startTime(startTime) + .skipPrograms(skipPrograms) + .build() + .withLatestPartition(); List> queryResp = new ArrayList<>(); queryResp.add(Map.of("dataelementid", 1)); @@ -277,9 +277,9 @@ void verifyGetTableWithCategoryCombo() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); List tables = subject.getAnalyticsTables(params); @@ -322,9 +322,9 @@ void verifyClientSideTimestampsColumns() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); List tables = subject.getAnalyticsTables(params); @@ -358,9 +358,9 @@ void verifyAnalyticsEventTableHasDefaultPartition() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); List tables = subject.getAnalyticsTables(params); @@ -444,9 +444,9 @@ void verifyGetTableWithDataElements() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); when(periodDataProvider.getAvailableYears(DATABASE)) @@ -548,9 +548,9 @@ void verifyGetTableWithTrackedEntityAttribute() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); when(periodDataProvider.getAvailableYears(DATABASE)) @@ -612,9 +612,9 @@ void verifyDataElementTypeOrgUnitFetchesOuNameWhenPopulatingEventAnalyticsTable( AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); when(periodDataProvider.getAvailableYears(DATABASE)) @@ -669,9 +669,9 @@ void verifyTeiTypeOrgUnitFetchesOuNameWhenPopulatingEventAnalyticsTable() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); when(jdbcTemplate.queryForList( @@ -719,9 +719,9 @@ void verifyOrgUnitOwnershipJoinsWhenPopulatingEventAnalyticsTable() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); when(jdbcTemplate.queryForList( @@ -780,7 +780,7 @@ void verifyGetAnalyticsTableWithOuLevels() { .thenReturn(List.of(2018, 2019)); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder().withStartTime(START_TIME).build(); + AnalyticsTableUpdateParams.newBuilder().startTime(START_TIME).build(); List tables = subject.getAnalyticsTables(params); @@ -820,7 +820,7 @@ void verifyGetAnalyticsTableWithOuGroupSet() { List availableDataYears = periodDataProvider.getAvailableYears(DATABASE); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder().withStartTime(START_TIME).build(); + AnalyticsTableUpdateParams.newBuilder().startTime(START_TIME).build(); when(jdbcTemplate.queryForList( getYearQueryForCurrentYear(programA, false, availableDataYears), Integer.class)) .thenReturn(List.of(2018, 2019)); @@ -865,7 +865,7 @@ void verifyGetAnalyticsTableWithOptionGroupSets() { .thenReturn(List.of(2018, 2019)); AnalyticsTableUpdateParams params = - AnalyticsTableUpdateParams.newBuilder().withStartTime(START_TIME).build(); + AnalyticsTableUpdateParams.newBuilder().startTime(START_TIME).build(); List tables = subject.getAnalyticsTables(params); @@ -966,9 +966,9 @@ void verifyTeaTypeOrgUnitFetchesOuNameWhenPopulatingEventAnalyticsTable() { AnalyticsTableUpdateParams params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(2) - .withStartTime(START_TIME) - .withToday(today) + .lastYears(2) + .startTime(START_TIME) + .today(today) .build(); List analyticsTables = subject.getAnalyticsTables(params); diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcOwnershipAnalyticsTableManagerTest.java b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcOwnershipAnalyticsTableManagerTest.java index fd8a9117a725..af3cc0b3e652 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcOwnershipAnalyticsTableManagerTest.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/table/JdbcOwnershipAnalyticsTableManagerTest.java @@ -201,7 +201,7 @@ void testGetAnalyticsTables() { params = AnalyticsTableUpdateParams.newBuilder() - .withLastYears(AnalyticsTablePartition.LATEST_PARTITION) + .lastYears(AnalyticsTablePartition.LATEST_PARTITION) .build(); assertEquals(emptyList(), target.getAnalyticsTables(params)); diff --git a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/data/AnalyticsServiceQueryModifiersTest.java b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/data/AnalyticsServiceQueryModifiersTest.java index 2bbe6c028295..b255ec1e142d 100644 --- a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/data/AnalyticsServiceQueryModifiersTest.java +++ b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/data/AnalyticsServiceQueryModifiersTest.java @@ -181,7 +181,7 @@ void setUp() { // Generate analytics tables analyticsTableGenerator.generateAnalyticsTables( - AnalyticsTableUpdateParams.newBuilder().withStartTime(oneSecondFromNow).build(), + AnalyticsTableUpdateParams.newBuilder().startTime(oneSecondFromNow).build(), JobProgress.noop()); } diff --git a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/data/AnalyticsServiceTest.java b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/data/AnalyticsServiceTest.java index 7b495548f4fa..63770a8c7a52 100644 --- a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/data/AnalyticsServiceTest.java +++ b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/data/AnalyticsServiceTest.java @@ -269,8 +269,7 @@ void setUp() throws IOException { processStartTime = new Date(); // Generate analytics tables analyticsTableGenerator.generateAnalyticsTables( - AnalyticsTableUpdateParams.newBuilder().withStartTime(tenSecondsFromNow).build(), - transitory()); + AnalyticsTableUpdateParams.newBuilder().startTime(tenSecondsFromNow).build(), transitory()); } private void setUpMetadata() { diff --git a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java index 92c1c802df7a..60a4b5bbd74e 100644 --- a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java +++ b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java @@ -576,7 +576,7 @@ void setUp() throws ConflictException { // Generate resource tables and analytics tables analyticsTableGenerator.generateAnalyticsTables( - AnalyticsTableUpdateParams.newBuilder().withStartTime(oneSecondFromNow).build(), + AnalyticsTableUpdateParams.newBuilder().startTime(oneSecondFromNow).build(), JobProgress.noop()); }