Skip to content

Commit ce9ff64

Browse files
går over til precondition-apiet
1 parent a1217da commit ce9ff64

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/kotlin/no/nav/helse/behovsakkumulator/Behovsakkumulator.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ class Behovsakkumulator(rapidsConnection: RapidsConnection) : River.PacketListen
2626

2727
init {
2828
River(rapidsConnection).apply {
29+
precondition {
30+
it.requireKey("@behov")
31+
it.requireKey("@løsning")
32+
it.forbid("@final")
33+
}
2934
validate {
30-
it.demandKey("@behov")
31-
it.demandKey("@løsning")
32-
it.rejectKey("@final")
3335
it.requireKey("@id")
3436
it.interestedIn("@behovId")
3537
it.interestedIn("vedtaksperiodeId")

0 commit comments

Comments
 (0)