-
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.
- Loading branch information
Showing
7 changed files
with
129 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
import org.springframework.core.env.Environment; | ||
|
||
import java.util.Optional; | ||
import java.util.UUID; | ||
import java.util.List; | ||
|
||
class ViestinvalitysClientTest extends BaseIntegraatioTesti { | ||
|
@@ -67,10 +66,18 @@ public void testLuoViesti() throws Exception { | |
.withTextSisalto("sisältö") | ||
.withKielet("fi") | ||
.withLahettaja(Optional.empty(), "[email protected]") | ||
.withVastaanottajat(b -> b.withVastaanottaja(Optional.empty(), "[email protected]")) | ||
.withVastaanottajat(Vastaanottajat.builder() | ||
.withVastaanottaja(Optional.empty(), "[email protected]") | ||
.build()) | ||
.withNormaaliPrioriteetti() | ||
.withSailytysAika(10) | ||
.withLahettavaPalvelu("palvelu") | ||
.withMetadatat(Metadatat.builder() | ||
.withMetadata("avain", List.of("arvo1", "arvo2")) | ||
.build()) | ||
.withMaskit(Maskit.builder() | ||
.withMaski("salaisuus", "maskattu") | ||
.build()) | ||
.build()); | ||
} | ||
|
||
|
@@ -87,7 +94,9 @@ public void testLiitaLiite() throws Exception { | |
.withTextSisalto("sisältö") | ||
.withKielet("fi") | ||
.withLahettaja(Optional.empty(), "[email protected]") | ||
.withVastaanottajat(b -> b.withVastaanottaja(Optional.empty(), "[email protected]")) | ||
.withVastaanottajat(Vastaanottajat.builder() | ||
.withVastaanottaja(Optional.empty(), "[email protected]") | ||
.build()) | ||
.withNormaaliPrioriteetti() | ||
.withSailytysAika(10) | ||
.withLahettavaPalvelu("palvelu") | ||
|
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
19 changes: 19 additions & 0 deletions
19
lahetysrajapinta/src/main/scala/fi/oph/viestinvalitys/vastaanotto/model/Maskit.java
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,19 @@ | ||
package fi.oph.viestinvalitys.vastaanotto.model; | ||
|
||
import java.util.List; | ||
|
||
import fi.oph.viestinvalitys.vastaanotto.model.Viesti.Maski; | ||
|
||
public interface Maskit { | ||
|
||
interface MaskitBuilder { | ||
|
||
MaskitBuilder withMaski(String salaisuus, String maski); | ||
|
||
List<Maski> build(); | ||
} | ||
|
||
static MaskitBuilder builder() { | ||
return new MaskitBuilderImpl(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
lahetysrajapinta/src/main/scala/fi/oph/viestinvalitys/vastaanotto/model/Metadatat.java
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,21 @@ | ||
package fi.oph.viestinvalitys.vastaanotto.model; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import fi.oph.viestinvalitys.vastaanotto.model.MetadatatBuilderImpl; | ||
|
||
public interface Metadatat { | ||
|
||
interface MetadatatBuilder { | ||
|
||
MetadatatBuilder withMetadata(String avain, List<String> arvot); | ||
|
||
Map<String, List<String>> build(); | ||
} | ||
|
||
static MetadatatBuilder builder() { | ||
return new MetadatatBuilderImpl(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
lahetysrajapinta/src/main/scala/fi/oph/viestinvalitys/vastaanotto/model/Vastaanottajat.java
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,18 @@ | ||
package fi.oph.viestinvalitys.vastaanotto.model; | ||
|
||
import java.util.Optional; | ||
import java.util.List; | ||
|
||
public interface Vastaanottajat { | ||
|
||
interface VastaanottajatBuilder { | ||
|
||
VastaanottajatBuilder withVastaanottaja(Optional<String> nimi, String sahkopostiOsoite); | ||
|
||
List<Viesti.Vastaanottaja> build(); | ||
} | ||
|
||
static VastaanottajatBuilder builder() { | ||
return new VastaanottajatBuilderImpl(); | ||
} | ||
} |
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