Skip to content

Commit

Permalink
fix: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
larshelge committed Dec 10, 2024
1 parent 8747d39 commit 311bb4f
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import static org.hisp.dhis.db.model.DataType.DOUBLE;
import static org.hisp.dhis.db.model.DataType.TEXT;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.when;

import java.util.List;
Expand All @@ -43,7 +42,6 @@
import org.hisp.dhis.setting.SystemSettings;
import org.hisp.dhis.setting.SystemSettingsProvider;
import org.joda.time.DateTime;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
Expand All @@ -63,11 +61,6 @@ class AnalyticsTableServiceTest {

@InjectMocks private DefaultAnalyticsTableService tableService;

@BeforeEach
void setUp() {
lenient().when(settingsProvider.getCurrentSettings()).thenReturn(settings);
}

@Test
void testGetTablePartitions() {
when(sqlBuilder.supportsDeclarativePartitioning()).thenReturn(false);
Expand Down Expand Up @@ -104,13 +97,15 @@ void testGetTablePartitions() {

@Test
void testGetParallelJobsA() {
when(settingsProvider.getCurrentSettings()).thenReturn(settings);
when(settings.getParallelJobsInAnalyticsTableExport()).thenReturn(1);

assertEquals(1, tableService.getParallelJobs());
}

@Test
void testGetParallelJobsB() {
when(settingsProvider.getCurrentSettings()).thenReturn(settings);
when(settings.getParallelJobsInAnalyticsTableExport()).thenReturn(-1);
when(settings.getDatabaseServerCpus()).thenReturn(8);

Expand Down

0 comments on commit 311bb4f

Please sign in to comment.