Skip to content

Commit

Permalink
MET-5960 update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeortizquan committed Oct 4, 2024
1 parent 9cd9c99 commit d569c62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import eu.europeana.metis.sandbox.dto.debias.DetectionInfoDto;
import eu.europeana.metis.sandbox.entity.DatasetEntity;
import eu.europeana.metis.sandbox.entity.debias.DetectionEntity;
import eu.europeana.metis.sandbox.repository.DatasetLogRepository;
import eu.europeana.metis.sandbox.repository.DatasetRepository;
import eu.europeana.metis.sandbox.repository.RecordLogRepository;
import eu.europeana.metis.sandbox.repository.debias.DetectRepository;
import java.time.ZonedDateTime;
import java.util.NoSuchElementException;
Expand All @@ -35,6 +37,12 @@ class DeBiasStateServiceTest {
@Mock
DatasetRepository datasetRepository;

@Mock
RecordLogRepository recordLogRepository;

@Mock
RecordDeBiasPublishable recordDeBiasPublishable;

@InjectMocks
DeBiasStateService debiasStateService;

Expand Down Expand Up @@ -249,7 +257,7 @@ void processWhenDatasetAlreadyExists_Ready_Processing_andError_expectSuccess() {

@Test
void set_and_get_State() {
debiasStateService.setState(new ReadyState(debiasStateService, detectRepository, datasetRepository));
debiasStateService.setState(new ReadyState(debiasStateService, detectRepository, datasetRepository, recordLogRepository, recordDeBiasPublishable));
assertInstanceOf(ReadyState.class, debiasStateService.getState());

debiasStateService.setState(new ProcessingState(debiasStateService, detectRepository));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void assertRepositoriesAndMeterRegistry() {
verify(recordRepository, times(2)).getMetricDatasetStatistics();
verify(recordLogRepository, times(2)).getMetricStepStatistics();
verify(problemPatternRepository, times(2)).getMetricProblemPatternStatistics();
assertEquals(61, meterRegistry.getMeters().size());
assertEquals(64, meterRegistry.getMeters().size());
}

@Test
Expand Down

0 comments on commit d569c62

Please sign in to comment.