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 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #373 from admin-ch/master
Update with sonar corrections
- Loading branch information
Showing
7 changed files
with
132 additions
and
60 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: Build, test and analyze | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'release/**' | ||
|
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
111 changes: 111 additions & 0 deletions
111
...tificate/api/mapper/pdfgeneration/AntibodyCertificatePdfGenerateRequestDtoMapperTest.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,111 @@ | ||
package ch.admin.bag.covidcertificate.api.mapper.pdfgeneration; | ||
|
||
import ch.admin.bag.covidcertificate.api.request.pdfgeneration.AntibodyCertificatePdfGenerateRequestDto; | ||
import ch.admin.bag.covidcertificate.service.domain.AntibodyCertificatePdf; | ||
import ch.admin.bag.covidcertificate.service.domain.CovidCertificateDiseaseOrAgentTargeted; | ||
import com.flextrade.jfixture.JFixture; | ||
import org.junit.Test; | ||
|
||
import static ch.admin.bag.covidcertificate.api.Constants.ISSUER; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class AntibodyCertificatePdfGenerateRequestDtoMapperTest { | ||
|
||
private final JFixture fixture = new JFixture(); | ||
private final String countryOfTest = "Schweiz"; | ||
private final String countryOfTestEn = "Switzerland"; | ||
|
||
@Test | ||
public void mapsFamilyName() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals(incoming.getDecodedCert().getPersonData().getName().getFamilyName(), actual.getFamilyName()); | ||
} | ||
|
||
@Test | ||
public void mapsGivenName() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals(incoming.getDecodedCert().getPersonData().getName().getGivenName(), actual.getGivenName()); | ||
} | ||
|
||
@Test | ||
public void mapsDateOfBirth() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals(incoming.getDecodedCert().getPersonData().getDateOfBirth(), actual.getDateOfBirth()); | ||
} | ||
|
||
@Test | ||
public void mapsLanguage() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals(incoming.getLanguage(), actual.getLanguage()); | ||
} | ||
|
||
@Test | ||
public void mapsDiseaseOrAgentTargetedCode() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals( | ||
CovidCertificateDiseaseOrAgentTargeted.getStandardInstance().getCode(), | ||
actual.getDiseaseOrAgentTargetedCode()); | ||
} | ||
|
||
@Test | ||
public void mapsDiseaseOrAgentTargetedSystem() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals( | ||
CovidCertificateDiseaseOrAgentTargeted.getStandardInstance().getSystem(), | ||
actual.getDiseaseOrAgentTargetedSystem()); | ||
} | ||
|
||
@Test | ||
public void mapsDateOfFirstPositiveTestResult() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals( | ||
incoming.getDecodedCert().getAntibodyInfo().get(0).getSampleDateTime().toLocalDate(), | ||
actual.getSampleDate()); | ||
} | ||
|
||
@Test | ||
public void mapsCountryOfTest() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals(countryOfTest, actual.getCountryOfTest()); | ||
} | ||
|
||
@Test | ||
public void mapsCountryOfTestEn() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals(countryOfTestEn, actual.getCountryOfTestEn()); | ||
} | ||
|
||
@Test | ||
public void mapsIssuer() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals(ISSUER, actual.getIssuer()); | ||
} | ||
|
||
@Test | ||
public void mapsUvci() { | ||
AntibodyCertificatePdfGenerateRequestDto incoming = fixture.create(AntibodyCertificatePdfGenerateRequestDto.class); | ||
AntibodyCertificatePdf actual = AntibodyCertificatePdfGenerateRequestDtoMapper.toAntibodyCertificatePdf( | ||
incoming, countryOfTest, countryOfTestEn); | ||
assertEquals(incoming.getDecodedCert().getAntibodyInfo().get(0).getIdentifier(), actual.getIdentifier()); | ||
} | ||
} |
50 changes: 0 additions & 50 deletions
50
...bag/covidcertificate/client/inapp_delivery/internal/DefaultInAppDeliveryClientITTest.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