-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fjern unødvendig abstraksjon * Fiks mergefeil
- Loading branch information
Showing
24 changed files
with
142 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
felles-test/src/main/kotlin/no/nav/helsearbeidsgiver/felles/test/json/DomeneUtils.kt
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
felles-test/src/main/kotlin/no/nav/helsearbeidsgiver/felles/test/json/ReadFail.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package no.nav.helsearbeidsgiver.felles.test.json | ||
|
||
import kotlinx.serialization.json.JsonElement | ||
import no.nav.helse.rapids_rivers.JsonMessage | ||
import no.nav.helse.rapids_rivers.MessageProblems | ||
import no.nav.helse.rapids_rivers.isMissingOrNull | ||
import no.nav.helsearbeidsgiver.felles.Key | ||
import no.nav.helsearbeidsgiver.felles.rapidsrivers.interestedIn | ||
import no.nav.helsearbeidsgiver.felles.rapidsrivers.model.Fail | ||
|
||
fun JsonElement.readFail(): Fail { | ||
val json = toString() | ||
val jsonMessage = JsonMessage(json, MessageProblems(json)).also { | ||
it.interestedIn(Key.EVENT_NAME, Key.BEHOV, Key.DATA, Key.FAIL) | ||
} | ||
return if (!jsonMessage[Key.FAIL.str].isMissingOrNull()) { | ||
Fail.packetValidator.validate(jsonMessage) | ||
Fail.create(jsonMessage) | ||
} else { | ||
throw RuntimeException("Message må være EVENT, DATA, BEHOV eller FAIL ${jsonMessage.toJson()}") | ||
} | ||
} |
87 changes: 0 additions & 87 deletions
87
felles-test/src/test/kotlin/no/nav/helsearbeidsgiver/felles/test/json/DomeneUtilsTest.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.