Skip to content

Commit

Permalink
fikset tester
Browse files Browse the repository at this point in the history
  • Loading branch information
jankroken-nav committed Oct 24, 2024
1 parent 15961e6 commit be2aaa8
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class BarnetrygdmottakerServiceTest : SpringContextTest.NoKafka() {
@Autowired
private lateinit var barnetrygdService: BarnetrygdmottakerService

@Autowired
private lateinit var sendTilBestemService: SendTilBestemService

@MockBean
private lateinit var kafkaTemplate: KafkaTemplate<String, String>

Expand Down Expand Up @@ -463,9 +466,10 @@ class BarnetrygdmottakerServiceTest : SpringContextTest.NoKafka() {
wiremock.`hent hjelpestønad ok - har hjelpestønad`()

barnetrygdService.process()
sendTilBestemService.process()

deserialize<PersongrunnlagMelding>(captor.allValues.single().value()).also { PersongrunnlagMelding ->
PersongrunnlagMelding.persongrunnlag.single().also { sak ->
deserialize<PersongrunnlagMelding>(captor.allValues.single().value()).also { persongrunnlagMelding ->
persongrunnlagMelding.persongrunnlag.single().also { sak ->
assertThat(sak.omsorgsperioder.count { it.omsorgstype == Omsorgstype.FULL_BARNETRYGD }).isEqualTo(1)
assertThat(
sak.hjelpestønadsperioder.count {
Expand Down Expand Up @@ -499,6 +503,7 @@ class BarnetrygdmottakerServiceTest : SpringContextTest.NoKafka() {
wiremock.`hent hjelpestønad ok - ingen hjelpestønad`()

barnetrygdService.process()
sendTilBestemService.process()

deserialize<PersongrunnlagMelding>(captor.allValues.single().value()).also { persongrunnlagMelding ->
persongrunnlagMelding.persongrunnlag.single().also { sak ->
Expand Down Expand Up @@ -532,9 +537,10 @@ class BarnetrygdmottakerServiceTest : SpringContextTest.NoKafka() {
wiremock.`hent hjelpestønad ok - ingen hjelpestønad`()

barnetrygdService.process()
sendTilBestemService.process()

deserialize<PersongrunnlagMelding>(captor.allValues.single().value()).also { PersongrunnlagMelding ->
PersongrunnlagMelding.persongrunnlag.single().also { sak ->
deserialize<PersongrunnlagMelding>(captor.allValues.single().value()).also { persongrunnlagMelding ->
persongrunnlagMelding.persongrunnlag.single().also { sak ->
assertThat(sak.omsorgsperioder).isEmpty()
assertThat(sak.hjelpestønadsperioder).isEmpty()
}
Expand Down

0 comments on commit be2aaa8

Please sign in to comment.