This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add endpoint and mock. refactor localized collections as maps
- Loading branch information
Showing
16 changed files
with
362 additions
and
118 deletions.
There are no files selected for viewing
141 changes: 141 additions & 0 deletions
141
.../src/main/java/ch/admin/bag/covidcertificate/backend/config/shared/helper/MockHelper.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,141 @@ | ||
package ch.admin.bag.covidcertificate.backend.config.shared.helper; | ||
|
||
import ch.admin.bag.covidcertificate.backend.config.shared.model.Faq; | ||
import ch.admin.bag.covidcertificate.backend.config.shared.model.FaqEntry; | ||
import ch.admin.bag.covidcertificate.backend.config.shared.model.InfoBox; | ||
import ch.admin.bag.covidcertificate.backend.config.shared.model.Language; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class MockHelper { | ||
public static Map<Language, Faq> getWorksMock() { | ||
Map<Language, Faq> works = new HashMap<>(); | ||
for (Language language : Language.values()) { | ||
Faq faq = new Faq(); | ||
faq.setFaqTitle("Wie funktioniert die App?"); | ||
faq.setFaqSubTitle( | ||
"Hier steht eine kurze Zusammenfassung. Das ist aber erst mal nur Blindtext. Das muss man dann noch ausformulieren und noch ein bisschen."); | ||
faq.setFaqIconIos("ic-how-it-works-image"); | ||
faq.setFaqIconAndroid("ic_how_it_works_image"); | ||
faq.setFaqEntries(getWorksFaqEntriesMock()); | ||
works.put(language, faq); | ||
} | ||
return works; | ||
} | ||
|
||
private static List<FaqEntry> getWorksFaqEntriesMock() { | ||
return List.of( | ||
getFaqEntryMock("Wie kann ich ein Covid-Zertifikat zur App hinzufügen?"), | ||
getFaqEntryMock("Können auch mehrere Zertifikate hinzugefügt werden?"), | ||
getFaqEntryMock("Wie sehe ich, ob mein Zertifikat gültig ist?"), | ||
getFaqEntryMock("Wie sind meine Daten geschützt?"), | ||
getFaqEntryMock("Welche Daten sind im QR-Code enthalten?")); | ||
} | ||
|
||
private static FaqEntry getFaqEntryMock(String title) { | ||
FaqEntry faqEntry = new FaqEntry(); | ||
faqEntry.setTitle(title); | ||
faqEntry.setText("Hier steht ein Text"); | ||
faqEntry.setIconAndroid(null); | ||
faqEntry.setIconIos(null); | ||
faqEntry.setLinkTitle(null); | ||
faqEntry.setLinkUrl(null); | ||
return faqEntry; | ||
} | ||
|
||
public static Map<Language, Faq> getQuestionsMock() { | ||
Map<Language, Faq> questions = new HashMap<>(); | ||
for (Language language : Language.values()) { | ||
Faq faq = new Faq(); | ||
faq.setFaqTitle("Was sind Covid-Zertifikate?"); | ||
faq.setFaqSubTitle( | ||
"Das Covid-Zertifikat ist eine Möglichkeit eine Covid-19-Impfung, eine durchgemachte Erkrankung oder ein negatives Testergebnis fälschungssicher zu dokumentieren."); | ||
faq.setFaqIconIos("ic-faq-image"); | ||
faq.setFaqIconAndroid("ic_faq_image"); | ||
faq.setFaqEntries(getQuestionFaqEntriesMock()); | ||
questions.put(language, faq); | ||
} | ||
return questions; | ||
} | ||
|
||
private static List<FaqEntry> getQuestionFaqEntriesMock() { | ||
return List.of( | ||
getFaqEntry0Mock(), | ||
getFaqEntry1Mock(), | ||
getFaqEntry2Mock(), | ||
getFaqEntry3Mock(), | ||
getFaqEntry4Mock()); | ||
} | ||
|
||
private static FaqEntry getFaqEntry0Mock() { | ||
FaqEntry faqEntry = new FaqEntry(); | ||
faqEntry.setTitle("Wann und wo kann ich ein Covid-Zertifikat erhalten?"); | ||
faqEntry.setText("Hier steht ein Text"); | ||
faqEntry.setIconAndroid(null); | ||
faqEntry.setIconIos(null); | ||
faqEntry.setLinkTitle(null); | ||
faqEntry.setLinkUrl(null); | ||
return faqEntry; | ||
} | ||
|
||
private static FaqEntry getFaqEntry1Mock() { | ||
FaqEntry faqEntry = new FaqEntry(); | ||
faqEntry.setTitle("Wie kann ich ein Covid-Zertifikat vorweisen?"); | ||
faqEntry.setText("Hier steht ein Text"); | ||
faqEntry.setIconAndroid(null); | ||
faqEntry.setIconIos(null); | ||
faqEntry.setLinkTitle(null); | ||
faqEntry.setLinkUrl(null); | ||
return faqEntry; | ||
} | ||
|
||
private static FaqEntry getFaqEntry2Mock() { | ||
FaqEntry faqEntry = new FaqEntry(); | ||
faqEntry.setTitle("Wo sind meine Daten gespeichert?"); | ||
faqEntry.setText("Hier steht ein Text"); | ||
faqEntry.setIconAndroid(null); | ||
faqEntry.setIconIos(null); | ||
faqEntry.setLinkTitle(null); | ||
faqEntry.setLinkUrl(null); | ||
return faqEntry; | ||
} | ||
|
||
private static FaqEntry getFaqEntry3Mock() { | ||
FaqEntry faqEntry = new FaqEntry(); | ||
faqEntry.setTitle("Wie werden Missbrauch und Fälschung verhindert?"); | ||
faqEntry.setText("Hier steht ein Text"); | ||
faqEntry.setIconAndroid(null); | ||
faqEntry.setIconIos(null); | ||
faqEntry.setLinkTitle(null); | ||
faqEntry.setLinkUrl(null); | ||
return faqEntry; | ||
} | ||
|
||
private static FaqEntry getFaqEntry4Mock() { | ||
FaqEntry faqEntry = new FaqEntry(); | ||
faqEntry.setTitle("Was passiert, wenn ich mein Covid-Zertifikat verliere?"); | ||
faqEntry.setText( | ||
"Ihr Covid-Zertifikat wird in keinem zentralen System gespeichert. Es befindet sich ausschliesslich in Ihrem Besitz. Bewahren Sie das Covid-Zertifikat auf Papier deshalb sorgfältig auf."); | ||
faqEntry.setIconAndroid(null); | ||
faqEntry.setIconIos(null); | ||
faqEntry.setLinkTitle(null); | ||
faqEntry.setLinkUrl(null); | ||
return faqEntry; | ||
} | ||
|
||
public static Map<Language, InfoBox> getInfoBoxMock() { | ||
Map<Language, InfoBox> infoBoxes = new HashMap<>(); | ||
for (Language language : Language.values()) { | ||
InfoBox infoBox = new InfoBox(); | ||
infoBox.setTitle("Noch keinen Covidcode?"); | ||
infoBox.setMsg( | ||
"Sie wurden positiv getestet (PCR-Test oder Antigen-Schnelltest) und haben nach 4h noch keinen Covidcode erhalten?\nDann kontaktieren Sie die Infoline Coronavirus:"); | ||
infoBox.setUrl("tel:+41583877780"); | ||
infoBox.setUrlTitle("+41 58 387 77 80"); | ||
infoBox.setIsDismissible(false); | ||
infoBoxes.put(language, infoBox); | ||
} | ||
return infoBoxes; | ||
} | ||
} |
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
44 changes: 0 additions & 44 deletions
44
...rc/main/java/ch/admin/bag/covidcertificate/backend/config/shared/model/FaqCollection.java
This file was deleted.
Oops, something went wrong.
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
55 changes: 0 additions & 55 deletions
55
...ain/java/ch/admin/bag/covidcertificate/backend/config/shared/model/InfoBoxCollection.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
...red/src/main/java/ch/admin/bag/covidcertificate/backend/config/shared/model/Language.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 ch.admin.bag.covidcertificate.backend.config.shared.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public enum Language { | ||
DE("de"), | ||
EN("en"), | ||
FR("fr"), | ||
IT("it"); | ||
|
||
private String key; | ||
|
||
Language(String key) { | ||
this.key = key; | ||
} | ||
|
||
@JsonValue | ||
public String getKey() { | ||
return key; | ||
} | ||
} |
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,5 @@ | ||
### config | ||
GET {{verifierBaseUrl}}/v1/verifier/config?appversion={{appversion}}&osversion={{osversion}}&buildnr={{buildnr}} | ||
Accept: application/json | ||
|
||
### |
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,5 @@ | ||
### config | ||
GET {{walletBaseUrl}}/v1/wallet/config?appversion={{appversion}}&osversion={{osversion}}&buildnr={{buildnr}} | ||
Accept: application/json | ||
|
||
### |
24 changes: 20 additions & 4 deletions
24
...ig/ch-covidcertificate-backend-config-shared/src/test/resources/http/http-client.env.json
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 |
---|---|---|
@@ -1,14 +1,30 @@ | ||
{ | ||
"local": { | ||
"baseUrl": "localhost:8080" | ||
"walletBaseUrl": "localhost:8080", | ||
"verifierBaseUrl": "localhost:8081", | ||
"appversion": "ios-1.1.0", | ||
"osversion": "ios14.1", | ||
"buildnr": "ios-210119.1234.123" | ||
}, | ||
"dev": { | ||
"baseUrl": "TODO" | ||
"walletBaseUrl": "TODO", | ||
"verifierBaseUrl": "TODO", | ||
"appversion": "ios-1.1.0", | ||
"osversion": "ios14.1", | ||
"buildnr": "ios-210119.1234.123" | ||
}, | ||
"abn": { | ||
"baseUrl": "TODO" | ||
"walletBaseUrl": "TODO", | ||
"verifierBaseUrl": "TODO", | ||
"appversion": "ios-1.1.0", | ||
"osversion": "ios14.1", | ||
"buildnr": "ios-210119.1234.123" | ||
}, | ||
"prod": { | ||
"baseUrl": "TODO" | ||
"walletBaseUrl": "TODO", | ||
"verifierBaseUrl": "TODO", | ||
"appversion": "ios-1.1.0", | ||
"osversion": "ios14.1", | ||
"buildnr": "ios-210119.1234.123" | ||
} | ||
} |
Oops, something went wrong.