Skip to content

Commit

Permalink
Add object and service dependencies in test setup
Browse files Browse the repository at this point in the history
This commit adds `ObjectMapper`, `TransaksjonMappingRepository`, `TransaksjonMappingService`, and `ErrorStatusDecoder` to `PensjonPensjonsdataServiceTest.java`. This ensures that the required dependencies are fully initialized and available for testing. It also removes the `@Disabled` annotation to enable the test suite.
  • Loading branch information
krharum committed Nov 26, 2024
1 parent 68de33a commit 92338fa
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package no.nav.dolly.bestilling.pensjonforvalter.service;

import com.fasterxml.jackson.databind.ObjectMapper;
import ma.glasnost.orika.MapperFacade;
import ma.glasnost.orika.MappingContext;
import no.nav.dolly.bestilling.pensjonforvalter.PensjonforvalterConsumer;
Expand All @@ -13,8 +14,10 @@
import no.nav.dolly.domain.jpa.BestillingProgress;
import no.nav.dolly.domain.resultset.RsDollyUtvidetBestilling;
import no.nav.dolly.domain.resultset.pensjon.PensjonData;
import no.nav.dolly.errorhandling.ErrorStatusDecoder;
import no.nav.dolly.repository.TransaksjonMappingRepository;
import no.nav.dolly.service.TransaksjonMappingService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -46,15 +49,19 @@
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;

@Disabled
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
class PensjonPensjonsdataServiceTest {

private static final String IDENT = "11111111111";

@Mock
private TransaksjonMappingRepository transaksjonMappingRepository;

@Spy
private PensjonforvalterHelper pensjonforvalterHelper;
private PensjonforvalterHelper pensjonforvalterHelper =
new PensjonforvalterHelper(new TransaksjonMappingService(transaksjonMappingRepository, new ObjectMapper()),
new ObjectMapper(), new ErrorStatusDecoder(new ObjectMapper()));

@Mock
private PensjonforvalterConsumer pensjonforvalterConsumer;
Expand Down

0 comments on commit 92338fa

Please sign in to comment.