diff --git a/common/pom.xml b/common/pom.xml index c77b2753..af8ac2ba 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ magda be.vlaanderen.vip.mock - 2.13.0 + 2.14.0 4.0.0 diff --git a/interfaces/pom.xml b/interfaces/pom.xml index cb958ad3..7c74d6aa 100644 --- a/interfaces/pom.xml +++ b/interfaces/pom.xml @@ -5,7 +5,7 @@ magda be.vlaanderen.vip.mock - 2.13.0 + 2.14.0 4.0.0 diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/CompanyMagdaRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/CompanyMagdaRequest.java index f91b964b..7f849eb2 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/CompanyMagdaRequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/CompanyMagdaRequest.java @@ -6,6 +6,7 @@ import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.ToString; /** * A request that pertains to a company, identified by KBO number. @@ -15,6 +16,7 @@ * */ @Getter +@ToString @EqualsAndHashCode(callSuper = true) public abstract class CompanyMagdaRequest extends MagdaRequest { diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefBetalingenHandicapRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefBetalingenHandicapRequest.java index 9a6b0f90..3507e809 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefBetalingenHandicapRequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefBetalingenHandicapRequest.java @@ -8,6 +8,7 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Null; import lombok.AccessLevel; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; @@ -31,6 +32,7 @@ */ @Getter @ToString +@EqualsAndHashCode(callSuper = true) public class GeefBetalingenHandicapRequest extends PersonMagdaRequest { public static class Builder extends PersonMagdaRequest.Builder { diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefDossierHandicapByDateRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefDossierHandicapByDateRequest.java new file mode 100644 index 00000000..d07ec926 --- /dev/null +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefDossierHandicapByDateRequest.java @@ -0,0 +1,155 @@ +package be.vlaanderen.vip.magda.client.diensten; + +import be.vlaanderen.vip.magda.client.MagdaDocument; +import be.vlaanderen.vip.magda.client.MagdaServiceIdentification; +import be.vlaanderen.vip.magda.client.diensten.subject.INSZNumber; +import be.vlaanderen.vip.magda.client.domeinservice.MagdaRegistrationInfo; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.NotNull; +import lombok.AccessLevel; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.ToString; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.Arrays; +import java.util.Set; + +/** + * A request to a "GeefDossierHandicap" MAGDA service, which provides information regarding disability for an INSZ. + * Adds the following fields to the {@link PersonMagdaRequest}: + * + * + * @see XML template for this request type + * @see More information on this request type + */ +@Getter +@ToString +@EqualsAndHashCode(callSuper = true) +public class GeefDossierHandicapByDateRequest extends PersonMagdaRequest { + + public static class Builder extends PersonMagdaRequest.Builder { + + @Getter(AccessLevel.PROTECTED) + private LocalDate referenceDate; + @Getter(AccessLevel.PROTECTED) + private Set sources; + @Getter(AccessLevel.PROTECTED) + private Set parts; + + + public Builder referenceDate(LocalDate date) { + this.referenceDate = date; + return this; + } + + public Builder sources(Set sources) { + this.sources = sources; + return this; + } + + public Builder parts(Set parts) { + this.parts = parts; + return this; + } + + public GeefDossierHandicapByDateRequest build() { + if(getInsz() == null) { throw new IllegalStateException("INSZ number must be given"); } + if(getReferenceDate() == null) { throw new IllegalStateException("Reference date must be given"); } + + return new GeefDossierHandicapByDateRequest( + getInsz(), + getRegistration(), + getReferenceDate(), + getSources(), + getParts() + ); + } + } + + public static Builder builder() { + return new Builder(); + } + + @NotNull + private final LocalDate referenceDate; + @Nullable + private final Set sources; + @Nullable + private final Set parts; + + public GeefDossierHandicapByDateRequest( + @NotNull INSZNumber insz, + @NotNull String registration, + @NotNull LocalDate referenceDate, + @Nullable Set sources, + @Nullable Set parts) { + super(insz, registration); + this.referenceDate = referenceDate; + this.sources = sources; + this.parts = parts; + } + + @Override + public MagdaServiceIdentification magdaServiceIdentification() { + return new MagdaServiceIdentification("GeefDossierHandicap", "03.00.0000"); + } + + @Override + protected void fillIn(MagdaDocument request, MagdaRegistrationInfo magdaRegistrationInfo) { + fillInCommonFields(request, magdaRegistrationInfo); + + var dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE; + request.setValue("//ConsultFilesByDateCriteria/ssin", getInsz().getValue()); + request.setValue("//ConsultFilesByDateCriteria/referenceDate", getReferenceDate().format(dateFormatter)); + Arrays.stream(HandicapAuthenticSourceType.values()).forEach(x -> { + request.createTextNode("//ConsultFilesByDateCriteria/handicapAuthenticSources", x.getTypeString(), getSources() != null && getSources().contains(x) ? "true" : "false"); + }); + Arrays.stream(HandicapFilePartType.values()).forEach(x -> { + request.createTextNode("//ConsultFilesByDateCriteria/parts", x.getTypeString(), getParts() != null && getParts().contains(x) ? "true" : "false"); + }); + + request.removeNode("//ConsultFilesByPeriodCriteria"); + } + + public enum HandicapAuthenticSourceType { + DGPH("DGPH"), + VSB("VSB"), + IRISCARE("IrisCare"), + NICCIN("NicCin"), + AVIQ("AVIQ"), + DSL("DSL"); + + private final String typeString; + + HandicapAuthenticSourceType(String typeString) { + this.typeString = typeString; + } + + public String getTypeString() { + return typeString; + } + } + + public enum HandicapFilePartType { + EVOLUTION_OF_REQUEST("evolutionOfRequest"), + HANDICAP_RECOGNITIONS("handicapRecognitions"), + RIGHTS("rights"), + SOCIAL_CARDS("socialCards"); + + private final String typeString; + + HandicapFilePartType(String typeString) { + this.typeString = typeString; + } + + public String getTypeString() { + return typeString; + } + } +} diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefFunctiesByPersonRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefFunctiesByPersonRequest.java index eb9b1779..1a7b562c 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefFunctiesByPersonRequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefFunctiesByPersonRequest.java @@ -8,6 +8,7 @@ import jakarta.annotation.Nullable; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; @@ -28,6 +29,7 @@ */ @Getter @ToString +@EqualsAndHashCode(callSuper = true) public class GeefFunctiesByPersonRequest extends PersonMagdaRequest{ public static class Builder extends PersonMagdaRequest.Builder { diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefHistoriekGezinssamenstellingRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefHistoriekGezinssamenstellingRequest.java index b3ff3260..43b7514d 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefHistoriekGezinssamenstellingRequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefHistoriekGezinssamenstellingRequest.java @@ -7,6 +7,7 @@ import jakarta.annotation.Nullable; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; @@ -27,6 +28,7 @@ */ @Getter @ToString +@EqualsAndHashCode(callSuper = true) public class GeefHistoriekGezinssamenstellingRequest extends PersonMagdaRequest { public static class Builder extends PersonMagdaRequest.Builder { diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefLeefLoonBedragenRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefLeefLoonBedragenRequest.java index ec3c917a..f927d4ce 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefLeefLoonBedragenRequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefLeefLoonBedragenRequest.java @@ -7,6 +7,7 @@ import jakarta.annotation.Nullable; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; @@ -26,6 +27,7 @@ */ @Getter @ToString +@EqualsAndHashCode(callSuper = true) public class GeefLeefLoonBedragenRequest extends PersonMagdaRequest { public static class Builder extends PersonMagdaRequest.Builder { diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefLoopbaanARZARequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefLoopbaanARZARequest.java index 7e694654..f71fcdbb 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefLoopbaanARZARequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefLoopbaanARZARequest.java @@ -6,6 +6,7 @@ import jakarta.annotation.Nullable; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; import java.time.LocalDate; @@ -23,6 +24,7 @@ */ @Getter @ToString +@EqualsAndHashCode(callSuper = true) public class GeefLoopbaanARZARequest extends PersonMagdaRequest { public static class Builder extends PersonMagdaRequest.Builder { diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefSociaalStatuutRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefSociaalStatuutRequest.java index 5ac86418..356d310f 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefSociaalStatuutRequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefSociaalStatuutRequest.java @@ -8,6 +8,7 @@ import jakarta.validation.constraints.NotNull; import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.ToString; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; @@ -25,6 +26,7 @@ * @see More information on this request type */ @Getter +@ToString @EqualsAndHashCode(callSuper = true) public class GeefSociaalStatuutRequest extends PersonMagdaRequest { diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefWerkrelatiesRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefWerkrelatiesRequest.java index a01deea2..83c73d65 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefWerkrelatiesRequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefWerkrelatiesRequest.java @@ -8,6 +8,7 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Null; import lombok.AccessLevel; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; @@ -31,6 +32,7 @@ */ @Getter @ToString +@EqualsAndHashCode(callSuper = true) public class GeefWerkrelatiesRequest extends PersonMagdaRequest{ public static class Builder extends PersonMagdaRequest.Builder { diff --git a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/PersonMagdaRequest.java b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/PersonMagdaRequest.java index 4d206761..727d6cdf 100644 --- a/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/PersonMagdaRequest.java +++ b/interfaces/src/main/java/be/vlaanderen/vip/magda/client/diensten/PersonMagdaRequest.java @@ -6,6 +6,7 @@ import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.ToString; /** * A request that pertains to a person, identified by INSZ number. @@ -15,6 +16,7 @@ * */ @Getter +@ToString @EqualsAndHashCode(callSuper = true) public abstract class PersonMagdaRequest extends MagdaRequest { diff --git a/interfaces/src/main/resources/templates/GeefDossierHandicap/03.00.0000/template.xml b/interfaces/src/main/resources/templates/GeefDossierHandicap/03.00.0000/template.xml new file mode 100644 index 00000000..e69a6bdb --- /dev/null +++ b/interfaces/src/main/resources/templates/GeefDossierHandicap/03.00.0000/template.xml @@ -0,0 +1,44 @@ + + + + + + + GeefDossierHandicap + 03.00.0000 + + VRAAG + + Datum + Tijd + + + Identificatie + Referte + Hoedanigheid + + + + + + Referte + + + + INSZ + + ReferenceDate + + false + false + + + + + + + + + + \ No newline at end of file diff --git a/interfaces/src/test/java/be/vlaanderen/vip/magda/client/diensten/GeefDossierHandicapByDateRequestTest.java b/interfaces/src/test/java/be/vlaanderen/vip/magda/client/diensten/GeefDossierHandicapByDateRequestTest.java new file mode 100644 index 00000000..9498dead --- /dev/null +++ b/interfaces/src/test/java/be/vlaanderen/vip/magda/client/diensten/GeefDossierHandicapByDateRequestTest.java @@ -0,0 +1,176 @@ +package be.vlaanderen.vip.magda.client.diensten; + +import be.vlaanderen.vip.magda.client.diensten.GeefDossierHandicapByDateRequest.Builder; +import be.vlaanderen.vip.magda.client.diensten.subject.INSZNumber; +import be.vlaanderen.vip.magda.client.domeinservice.MagdaRegistrationInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.time.LocalDate; +import java.util.Set; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.*; + +class GeefDossierHandicapByDateRequestTest { + + @Nested + class GeefDossierHandicapByDateRequestBuilder { + + @Test + void buildsRequest() { + var referenceDate = LocalDate.now(); + var sources = Set.of( + GeefDossierHandicapByDateRequest.HandicapAuthenticSourceType.DGPH, + GeefDossierHandicapByDateRequest.HandicapAuthenticSourceType.VSB + ); + var parts = Set.of( + GeefDossierHandicapByDateRequest.HandicapFilePartType.RIGHTS, + GeefDossierHandicapByDateRequest.HandicapFilePartType.SOCIAL_CARDS + ); + + var request = GeefDossierHandicapByDateRequest.builder() + .insz(TestBase.TEST_INSZ) + .referenceDate(referenceDate) + .sources(sources) + .parts(parts) + .build(); + + assertEquals(INSZNumber.of(TestBase.TEST_INSZ), request.getInsz()); + assertEquals(referenceDate, request.getReferenceDate()); + assertEquals(sources, request.getSources()); + assertEquals(parts, request.getParts()); + } + + @Test + void throwsException_whenInszNull() { + var referenceDate = LocalDate.now(); + + var builder = GeefDossierHandicapByDateRequest.builder() + .referenceDate(referenceDate); + + assertThrows(IllegalStateException.class, builder::build); + } + + @Test + void throwsException_whenReferenceDateNull() { + var builder = GeefDossierHandicapByDateRequest.builder() + .insz(TestBase.TEST_INSZ); + + assertThrows(IllegalStateException.class, builder::build); + } + + @Test + void sourcesIsOptional() { + var referenceDate = LocalDate.now(); + + var request = GeefDossierHandicapByDateRequest.builder() + .insz(TestBase.TEST_INSZ) + .referenceDate(referenceDate) + .build(); + + assertNull(request.getSources()); + } + + @Test + void partsIsOptional() { + var referenceDate = LocalDate.now(); + + var request = GeefDossierHandicapByDateRequest.builder() + .insz(TestBase.TEST_INSZ) + .referenceDate(referenceDate) + .build(); + + assertNull(request.getParts()); + } + } + + @Nested + class ToMagdaDocument { + private MagdaRegistrationInfo info; + private Builder builder; + + @BeforeEach + void setup() { + + info = MagdaRegistrationInfo.builder() + .identification("identification") + .hoedanigheidscode("identification") + .build(); + + builder = GeefDossierHandicapByDateRequest.builder() + .insz(TestBase.TEST_INSZ) + .referenceDate(LocalDate.now()); + } + + @Test + void setsFields() { + var sources = Set.of( + GeefDossierHandicapByDateRequest.HandicapAuthenticSourceType.DGPH, + GeefDossierHandicapByDateRequest.HandicapAuthenticSourceType.VSB + ); + var parts = Set.of( + GeefDossierHandicapByDateRequest.HandicapFilePartType.RIGHTS, + GeefDossierHandicapByDateRequest.HandicapFilePartType.SOCIAL_CARDS + ); + + + var request = builder + .insz(TestBase.TEST_INSZ) + .referenceDate(LocalDate.of(2022, 01, 22)) + .sources(sources) + .parts(parts) + .build() + .toMagdaDocument(info); + + assertThat(request.getValue("//ConsultFilesByDateCriteria/ssin"), is(equalTo(TestBase.TEST_INSZ))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/referenceDate"), is(equalTo("2022-01-22"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/DGPH"), is(equalTo("true"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/VSB"), is(equalTo("true"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/IrisCare"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/NicCin"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/AVIQ"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/DSL"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/parts/evolutionOfRequest"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/parts/handicapRecognitions"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/parts/rights"), is(equalTo("true"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/parts/socialCards"), is(equalTo("true"))); + } + + @Test + void doesNotSetSourcesOrPartsIfNotSpecified(){ + + var request = builder + .insz(TestBase.TEST_INSZ) + .referenceDate(LocalDate.of(2022, 01, 22)) + .build() + .toMagdaDocument(info); + + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/DGPH"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/VSB"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/IrisCare"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/NicCin"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/AVIQ"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/handicapAuthenticSources/DSL"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/parts/evolutionOfRequest"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/parts/handicapRecognitions"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/parts/rights"), is(equalTo("false"))); + assertThat(request.getValue("//ConsultFilesByDateCriteria/parts/socialCards"), is(equalTo("false"))); + } + + @Test + void doesRemoveConsultFilesByPeriodCriteriaElement(){ + + var request = builder + .insz(TestBase.TEST_INSZ) + .referenceDate(LocalDate.of(2022, 01, 22)) + .build() + .toMagdaDocument(info); + + assertNull(request.getValue("//ConsultFilesByPeriodCriteria")); + } + } +} diff --git a/magdaconnector/pom.xml b/magdaconnector/pom.xml index 9417cd03..a4c419fa 100644 --- a/magdaconnector/pom.xml +++ b/magdaconnector/pom.xml @@ -5,7 +5,7 @@ magda be.vlaanderen.vip.mock - 2.13.0 + 2.14.0 4.0.0 diff --git a/magdamock-starter/pom.xml b/magdamock-starter/pom.xml index 99876fe4..8cf52411 100644 --- a/magdamock-starter/pom.xml +++ b/magdamock-starter/pom.xml @@ -8,7 +8,7 @@ magda be.vlaanderen.vip.mock - 2.13.0 + 2.14.0 magdamock-starter diff --git a/magdamock-starter/src/main/java/be/vlaanderen/vip/mock/starter/connector/MagdaConfigBuilder.java b/magdamock-starter/src/main/java/be/vlaanderen/vip/mock/starter/connector/MagdaConfigBuilder.java index fa34a270..662addbf 100644 --- a/magdamock-starter/src/main/java/be/vlaanderen/vip/mock/starter/connector/MagdaConfigBuilder.java +++ b/magdamock-starter/src/main/java/be/vlaanderen/vip/mock/starter/connector/MagdaConfigBuilder.java @@ -1,15 +1,14 @@ package be.vlaanderen.vip.mock.starter.connector; -import java.util.HashMap; -import java.util.Map; - -import org.springframework.vault.core.VaultTemplate; - import be.vlaanderen.vip.magda.client.MagdaRequest; import be.vlaanderen.vip.magda.client.security.TwoWaySslProperties; import be.vlaanderen.vip.magda.config.MagdaConfigDto; import be.vlaanderen.vip.magda.config.MagdaRegistrationConfigDto; import lombok.extern.slf4j.Slf4j; +import org.springframework.vault.core.VaultTemplate; + +import java.util.HashMap; +import java.util.Map; @Slf4j public class MagdaConfigBuilder { @@ -61,7 +60,7 @@ public MagdaConfigDto build() { var config = new MagdaConfigDto(); config.setKeystore(keystore); - config.setVerificationEnabled(keystore != null); + config.setVerificationEnabled(false); // TODO always disable verification for now, because it doesn't work as it should yet (see MagdaSignedConnection) config.setRegistration(registrations); return config; } diff --git a/magdamock-starter/src/main/java/be/vlaanderen/vip/mock/starter/connector/RemoteMagdaConnectionBuilder.java b/magdamock-starter/src/main/java/be/vlaanderen/vip/mock/starter/connector/RemoteMagdaConnectionBuilder.java index 7e0fdea4..974decc4 100644 --- a/magdamock-starter/src/main/java/be/vlaanderen/vip/mock/starter/connector/RemoteMagdaConnectionBuilder.java +++ b/magdamock-starter/src/main/java/be/vlaanderen/vip/mock/starter/connector/RemoteMagdaConnectionBuilder.java @@ -1,9 +1,8 @@ package be.vlaanderen.vip.mock.starter.connector; -import org.springframework.util.Assert; - import be.vlaanderen.vip.magda.client.MagdaConnector; import be.vlaanderen.vip.magda.client.MagdaConnectorImpl; +import be.vlaanderen.vip.magda.client.MagdaSignedConnection; import be.vlaanderen.vip.magda.client.MagdaSoapConnection; import be.vlaanderen.vip.magda.client.domeinservice.MagdaHoedanigheidServiceImpl; import be.vlaanderen.vip.magda.client.endpoints.MagdaEndpoints; @@ -11,6 +10,7 @@ import be.vlaanderen.vip.magda.config.MagdaConfigDto; import be.vlaanderen.vip.magda.legallogging.service.ClientLogService; import brave.Tracing; +import org.springframework.util.Assert; public class RemoteMagdaConnectionBuilder { private ClientLogService logService; @@ -47,18 +47,17 @@ public MagdaConnector build() throws TwoWaySslException { if(logService == null) { logService = new DebugLogService(); } - - var connection = createConnection(); + + var connection = new MagdaSignedConnection(createSoapConnection(), magdaConfig); var hoedaingheidService = new MagdaHoedanigheidServiceImpl(magdaConfig); return new MagdaConnectorImpl(connection, logService, hoedaingheidService); } - private MagdaSoapConnection createConnection() throws TwoWaySslException { + private MagdaSoapConnection createSoapConnection() throws TwoWaySslException { if(tracing != null) { return new MagdaSoapConnection(endpoints, magdaConfig, tracing); } return new MagdaSoapConnection(endpoints, magdaConfig); } - -} +} \ No newline at end of file diff --git a/magdamock-starter/src/test/java/be/vlaanderen/vip/mock/starter/connector/MagdaConfigBuilderTest.java b/magdamock-starter/src/test/java/be/vlaanderen/vip/mock/starter/connector/MagdaConfigBuilderTest.java index 51b76bf7..bd0fea53 100644 --- a/magdamock-starter/src/test/java/be/vlaanderen/vip/mock/starter/connector/MagdaConfigBuilderTest.java +++ b/magdamock-starter/src/test/java/be/vlaanderen/vip/mock/starter/connector/MagdaConfigBuilderTest.java @@ -75,7 +75,7 @@ void addsVaultSslProperties_whenVaultConfigPresent() { .build(); assertAll( - () -> assertThat(result.isVerificationEnabled(), is(true)), + () -> assertThat(result.isVerificationEnabled(), is(false)), () -> assertThat(result.getKeystore(), is(equalTo(keystore)))); } @@ -89,7 +89,7 @@ void addsSslProperties_whenConfigPresent() { .build(); assertAll( - () -> assertThat(result.isVerificationEnabled(), is(true)), + () -> assertThat(result.isVerificationEnabled(), is(false)), () -> assertThat(result.getKeystore(), is(equalTo(keystore)))); } diff --git a/magdamock/pom.xml b/magdamock/pom.xml index f5d7806a..d9f290b8 100644 --- a/magdamock/pom.xml +++ b/magdamock/pom.xml @@ -3,7 +3,7 @@ magda be.vlaanderen.vip.mock - 2.13.0 + 2.14.0 4.0.0 diff --git a/magdamock/src/main/java/be/vlaanderen/vip/mock/magda/client/simulators/GeefDossierHandicapSimulator.java b/magdamock/src/main/java/be/vlaanderen/vip/mock/magda/client/simulators/GeefDossierHandicapSimulator.java new file mode 100644 index 00000000..9f685a9f --- /dev/null +++ b/magdamock/src/main/java/be/vlaanderen/vip/mock/magda/client/simulators/GeefDossierHandicapSimulator.java @@ -0,0 +1,23 @@ +package be.vlaanderen.vip.mock.magda.client.simulators; + +import be.vlaanderen.vip.magda.client.MagdaDocument; +import be.vlaanderen.vip.mock.magda.inventory.ResourceFinder; + +import java.util.Arrays; +import java.util.List; + +public class GeefDossierHandicapSimulator extends StaticResponseSimulator { + public GeefDossierHandicapSimulator(ResourceFinder finder, String type, List keys) { + super(finder, type, keys); + } + + public GeefDossierHandicapSimulator(ResourceFinder finder, String type, String... keys) { + this(finder, type, Arrays.asList(keys)); + } + + protected void patchResponse(MagdaDocument request, MagdaDocument response) { + super.patchResponse(request, response); + + response.setValue("//ssin", request.getValue("//ssin")); + } +} diff --git a/magdamock/src/main/java/be/vlaanderen/vip/mock/magda/client/simulators/SOAPSimulatorBuilder.java b/magdamock/src/main/java/be/vlaanderen/vip/mock/magda/client/simulators/SOAPSimulatorBuilder.java index 5e194ed7..b6408ea0 100644 --- a/magdamock/src/main/java/be/vlaanderen/vip/mock/magda/client/simulators/SOAPSimulatorBuilder.java +++ b/magdamock/src/main/java/be/vlaanderen/vip/mock/magda/client/simulators/SOAPSimulatorBuilder.java @@ -75,6 +75,7 @@ public SOAPSimulatorBuilder magdaMockSimulator(boolean copyPropertiesFromRequest simulator.register("GeefGezinssamenstelling", VERSION_02_02, new StaticResponseSimulator(finder, PERSOON, KEY_INSZ)); simulator.register("GeefHistoriekGezinssamenstelling", VERSION_02_02, new StaticResponseSimulator(finder, PERSOON, KEY_INSZ)); simulator.register("GeefBetalingenHandicap", VERSION_03_00, new StaticResponseSimulator(finder, PERSOON, KEY_SSIN)); + simulator.register("GeefDossierHandicap", VERSION_03_00, new GeefDossierHandicapSimulator(finder, PERSOON, KEY_SSIN)); simulator.register("GeefLeefloonbedragen", VERSION_02_00, new StaticResponseSimulator(finder, PERSOON, KEY_INSZ)); simulator.register("GeefDossierKBI", VERSION_01_00, new StaticResponseSimulator(finder, PERSOON, KEY_INSZ)); diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/04651999966.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/04651999966.xml new file mode 100644 index 00000000..8ac2c99d --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/04651999966.xml @@ -0,0 +1,79 @@ + + + + GeefDossierHandicap + 03.00.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + e23e15c1-3cea-4a87-b809-1c98c8b8aadb + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + 04651999966 + + filteredElement + filteredElement1 + + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + + + + 2023-05-15 + 2030-05-15 + 6677889900 + REDUCTIONCARD + + + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/10712995476.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/10712995476.xml new file mode 100644 index 00000000..8ae241ab --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/10712995476.xml @@ -0,0 +1,47 @@ + + + + GeefDossierHandicap + 03.00.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 95ca99a7-8a50-4bf8-95ae-5190ad1a3c3e + + + + DATA_FOUND + MSG00000 + + 10712995476 + + + + DATA_FOUND + MSG00000 + + + + + + + + + \ No newline at end of file diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/12630962125.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/12630962125.xml new file mode 100644 index 00000000..e6616060 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/12630962125.xml @@ -0,0 +1,85 @@ + + + + GeefDossierHandicap + 03.00.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + de2cd55e-3b02-455f-853e-148aff35469a + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + 12630962125 + + filteredElement + filteredElement1 + + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + + + + 2020-02-02 + 2030-02-02 + 1122334455 + PARKINGCARD + + + 2020-02-02 + 2030-02-02 + 6677889900 + REDUCTIONCARD + + + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/14690315873.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/14690315873.xml new file mode 100644 index 00000000..dba24f88 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/14690315873.xml @@ -0,0 +1,79 @@ + + + + GeefDossierHandicap + 03.00.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + de2cd55e-3b02-455f-853e-148aff35469a + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + 14690315873 + + filteredElement + filteredElement1 + + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + + + + 2024-03-01 + 2030-03-01 + 1122334455 + PARKINGCARD + + + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/88681575651.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/88681575651.xml new file mode 100644 index 00000000..36a73936 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/88681575651.xml @@ -0,0 +1,75 @@ + + + + GeefDossierHandicap + 03.00.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 70ccd08f-01f7-433f-a632-980d02fc1c79 + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + 88681575651 + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + + + + 2022-02-01 + 2030-02-01 + 1234567890 + PARKINGCARD + + + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/89702316648.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/89702316648.xml new file mode 100644 index 00000000..dab37ca9 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/89702316648.xml @@ -0,0 +1,79 @@ + + + + GeefDossierHandicap + 03.00.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 41241c21-de52-411b-9e49-ab6d959439e4 + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + 89702316648 + + filteredElement + filteredElement1 + + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + + + + 2022-10-15 + 2030-10-15 + 6677889900 + REDUCTIONCARD + + + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/96721418968.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/96721418968.xml new file mode 100644 index 00000000..8b13e137 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/96721418968.xml @@ -0,0 +1,75 @@ + + + + GeefDossierHandicap + 03.00.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 3e77b552-a04a-4143-92af-b3fc57e5a710 + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + 96721418968 + + + + DATA_FOUND + MSG00000 + Treatment successful + + fieldName1 + fieldValue1 + + + fieldName2 + fieldValue2 + + + + + + 2023-06-01 + 2030-06-01 + 1234567890 + PARKINGCARD + + + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/notfound.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/notfound.xml new file mode 100644 index 00000000..a612dfaf --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefDossierHandicap/03.00.0000/notfound.xml @@ -0,0 +1,89 @@ + + + + GeefDossierHandicap + 03.00.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + d925bbb8-a14f-47cb-b81c-255644da8acd + + + + NO_DATA_FOUND + MSG00100 + Treatment successful, but no data found at the supplier. + + 00000000000 + + + + NO_DATA_FOUND + MSG00021 + Treatment successful, but no data found at the supplier. + + + + + + + NO_DATA_FOUND + MSG00100 + Treatment successful, but no data found at the supplier. + + 00000000000 + + + + NO_DATA_FOUND + MSG00021 + Treatment successful, but no data found at the supplier. + + + + + + + + 70001 + KSZ + WAARSCHUWING + + 2024-03-15 + 10:21:40.797 + + Antwoord met waarschuwing + NO_DATA_FOUND + + + status code + MSG00100 + + + status description + Treatment successful, but no data found at the supplier. + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/04651999966.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/04651999966.xml new file mode 100644 index 00000000..02779e94 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/04651999966.xml @@ -0,0 +1,139 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-20 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 1aa6cc03-a7f5-47fd-8b77-da3bbc837a61 + + + 04651999966 + + + De Smet + + + Adam + + + + 1 + Mannelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 2004-05-19 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Brugsesteenweg + nl + + 581 + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 85681335759 + + + De Smet + + + Frank + + + + 1 + Mannelijk + + 1985-08-13 + + 06 + Vader + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/08670548333.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/08670548333.xml new file mode 100644 index 00000000..2aa42333 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/08670548333.xml @@ -0,0 +1,136 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 3a1b36a9-5bd4-420b-bb55-7ffe7a879807 + + + 08670548333 + + + Vlietinck + + + Sven + + + + 1 + Mannelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 2008-07-05 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Hoogstraat + nl + + 70 + A + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 84640438954 + + + Vlietinck + + + Jurgen + + + 1984-04-04 + + 03 + Zoon + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/10712995476.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/10712995476.xml new file mode 100644 index 00000000..806c1ba4 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/10712995476.xml @@ -0,0 +1,136 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 58ab7288-5b96-4de3-bf08-4701730af07a + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + b150a0c7-8d28-4b2e-8e0b-69e133f54c07 + + + 10712995476 + + + Vlietinck + + + Marie + + + + 2 + Vrouwelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 2010-11-29 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Hoogstraat + nl + + 70 + A + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 84640438954 + + + Vlietinck + + + Jurgen + + + 1984-04-04 + + 03 + Dochter + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/12630962125.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/12630962125.xml new file mode 100644 index 00000000..83d1ecce --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/12630962125.xml @@ -0,0 +1,136 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 149899d6-0efe-440f-9405-acd7d9b20396 + + + 12630962125 + + + Vlietinck + + + Jorn + + + + 1 + Mannelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 2012-03-09 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Hoogstraat + nl + + 70 + A + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 84640438954 + + + Vlietinck + + + Jurgen + + + 1984-04-04 + + 03 + Zoon + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/14690315873.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/14690315873.xml new file mode 100644 index 00000000..39b0505e --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/14690315873.xml @@ -0,0 +1,139 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 6ab5ae4e-f154-43c3-96bf-789d46716fc9 + + + 14690315873 + + + Maes + + + Eloïse + + + + 2 + Vrouwelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 2014-09-03 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Europalaan + nl + + 119 + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 87721315936 + + + Maes + + + Arne + + + + 1 + Mannelijk + + 1987-12-13 + + 06 + Vader + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/15631596945.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/15631596945.xml new file mode 100644 index 00000000..253ad7a0 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/15631596945.xml @@ -0,0 +1,139 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 690ba314-589f-4d5f-ae51-8cd6abc1db3b + + + 15631596945 + + + Maes + + + Filip + + + + 1 + Mannelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 2015-03-15 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Europalaan + nl + + 119 + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 87721315936 + + + Maes + + + Arne + + + + 1 + Mannelijk + + 1987-12-13 + + 06 + Vader + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/66691666644.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/66691666644.xml new file mode 100644 index 00000000..677ebc47 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/66691666644.xml @@ -0,0 +1,128 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 73e848c1-97a1-4136-a99b-b9bda0381103 + + + 66691666644 + + + Lemmens + + + Violette + + + + 2 + Vrouwelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 1966-09-16 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Bagattenstraat + nl + + 78 + D + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + + + 01 + Alleenstaand referentiepersoon + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/84640438954.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/84640438954.xml new file mode 100644 index 00000000..9b2ef1cf --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/84640438954.xml @@ -0,0 +1,230 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + b150a0c7-8d28-4b2e-8e0b-69e133f54c07 + + + 84640438954 + + + Vlietinck + + + Jurgen + + + + 1 + Mannelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 1984-04-04 + + + 73066 + Riemst + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Hoogstraat + nl + + 70 + A + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 56011785314 + + + Vlietinck + + + Jef + + + 1956-01-17 + + 03 + Zoon + + + + + 88681575651 + + + Serruys + + + Anna + + + + 2 + Vrouwelijk + + 1988-08-15 + + 02 + Echtgenote + + + 00 + + + + 08670548333 + + + Vlietinck + + + Sven + + + + 1 + Mannelijk + + 2008-07-05 + + 03 + Zoon + + + 00 + + + + 10712995476 + + + Vlietinck + + + Marie + + + + 2 + Vrouwelijk + + 2010-11-29 + + 03 + Dochter + + + 00 + + + + 05691199737 + + + Vlietinck + + + Jorn + + + + 1 + Mannelijk + + 2012-03-09 + + 03 + Zoon + + + 00 + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/84661785486.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/84661785486.xml new file mode 100644 index 00000000..b608d40f --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/84661785486.xml @@ -0,0 +1,139 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-20 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 74ab1f87-79c0-4394-8764-1db52b9afb51 + + + 84661785486 + + + Dewilde + + + Victoria + + + + 2 + Vrouwelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 1984-06-17 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Brugsesteenweg + nl + + 581 + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 85681335759 + + + De Smet + + + Frank + + + + 1 + Mannelijk + + 1985-08-13 + + 21 + Echtgenoot + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/85681335759.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/85681335759.xml new file mode 100644 index 00000000..5e029e72 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/85681335759.xml @@ -0,0 +1,167 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-20 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 38be0b94-33b5-4a0a-8cef-96249f9f1985 + + + 85681335759 + + + De Smet + + + Frank + + + + 1 + Mannelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 1985-08-13 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Brugsesteenweg + nl + + 581 + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + + 84661785486 + + + Dewilde + + + Victoria + + + + 2 + Vrouwelijk + + 1984-06-17 + + 21 + Partner + + + 00 + + + + 04651999966 + + + De Smet + + + Adam + + + + 1 + Mannelijk + + 2004-05-19 + + 03 + Zoon + + + 00 + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/87721315936.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/87721315936.xml new file mode 100644 index 00000000..18364e8d --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/87721315936.xml @@ -0,0 +1,190 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + b150a0c7-8d28-4b2e-8e0b-69e133f54c07 + + + 87721315936 + + + Maes + + + Arne + + + + 1 + Mannelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 1987-12-13 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Europalaan + nl + + 119 + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + + 89702316648 + + + Claes + + + Laura + + + + 2 + Vrouwelijk + + 1989-10-23 + + 22 + Wettelijke samenwonende + + + 00 + + + + 14690315873 + + + Maes + + + Eloïse + + + + 2 + Vrouwelijk + + 2014-09-03 + + 03 + Dochter + + + 00 + + + + 15631596945 + + + Maes + + + Filip + + + + 1 + Mannelijk + + 2015-03-15 + + 03 + Zoon + + + 00 + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/88681575651.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/88681575651.xml new file mode 100644 index 00000000..82863b21 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/88681575651.xml @@ -0,0 +1,136 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 235516b0-1552-492b-8c62-23819358d275 + + + 88681575651 + + + Serruys + + + Anna + + + + 2 + Vrouwelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 1988-08-15 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Hoogstraat + nl + + 70 + A + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 84640438954 + + + Vlietinck + + + Jurgen + + + 1984-04-04 + + 02 + Echtgenoot + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/89702316648.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/89702316648.xml new file mode 100644 index 00000000..70c3de06 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/89702316648.xml @@ -0,0 +1,139 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-15 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + b150a0c7-8d28-4b2e-8e0b-69e133f54c07 + + + 89702316648 + + + Claes + + + Laura + + + + 2 + Vrouwelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 1989-10-23 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Europalaan + nl + + 119 + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + 87721315936 + + + Maes + + + Arne + + + + 1 + Mannelijk + + 1987-12-13 + + 22 + Wettelijke samenwonende + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/96721418968.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/96721418968.xml new file mode 100644 index 00000000..3c71479a --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefPersoon/02.02.0000/96721418968.xml @@ -0,0 +1,145 @@ + + + + + GeefPersoon + 02.02.0000 + + ANTWOORD + + 2024-03-20 + 10:21:40.797 + + + vip.vlaanderen.be + VIP + 229b11a6-2b3d-4086-b8bd-da9bf6d97fc2 + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 3d9555a8-5702-41f6-a979-c75bdca6a603 + + + 96721418968 + + + Saidi + + + Mohammed + + + + 1 + Mannelijk + + + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + + 0 + NEEN + + + 2 + Nederlands + + + + RR + Rijksregister + + + + 150 + Belg + + + + 1996-12-14 + + + 44021 + Gent + + + 150 + BEL + BELGIE + + + 80985 + + 00 + Uittreksel uit de geboorteakte + + + + + + Blankenbergsestraat + nl + + 23 + 001 + + Gent + nl + + + BELGIE + nl + + 9000 + 150 + BEL + 44021 + + + + + 98640966618 + + + Saidi + + + Amina + + + + 2 + Vrouwelijk + + 1998-04-09 + + 09 + Zuster + + + 00 + + + + + + + + + diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefSociaalStatuut/03.00.0000/BIM_BVT/66691666644.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefSociaalStatuut/03.00.0000/BIM_BVT/66691666644.xml new file mode 100644 index 00000000..4d183f08 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefSociaalStatuut/03.00.0000/BIM_BVT/66691666644.xml @@ -0,0 +1,51 @@ + + + + + GeefSociaalStatuut + 03.00.0000 + + ANTWOORD + + 2024-03-21 + 12:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 0c99e3e6-c91c-4870-911a-c093f6984b52 + + + 66691666644 + + + BIM_BVT + + 1 + Van toepassing + + + + 2024-01-01 + 2030-01-01 + + + + + + + + + + \ No newline at end of file diff --git a/magdamock/src/main/resources/magda_simulator/Persoon/GeefSociaalStatuut/03.00.0000/BIM_BVT_IN_FAMILY/84640438954.xml b/magdamock/src/main/resources/magda_simulator/Persoon/GeefSociaalStatuut/03.00.0000/BIM_BVT_IN_FAMILY/84640438954.xml new file mode 100644 index 00000000..9c779415 --- /dev/null +++ b/magdamock/src/main/resources/magda_simulator/Persoon/GeefSociaalStatuut/03.00.0000/BIM_BVT_IN_FAMILY/84640438954.xml @@ -0,0 +1,55 @@ + + + + + GeefSociaalStatuut + 03.00.0000 + + ANTWOORD + + 2024-03-21 + 12:21:40.797 + + + vip.vlaanderen.be + MagdaGateway + d00c2291-f643-489f-8071-791822f0ad8f + + + gent.be/ipdc2858 + AREF_QT_860921_102202 + ipdc2858 + + + + + + 7a696608-6107-4d50-81fe-1baefc8028ab + + + 84640438954 + + + BIM_BVT_IN_FAMILY + + 1 + Van toepassing + + + + 2024-01-01 + 2030-01-01 + + + + SSH00047 + + + + + + + + + + \ No newline at end of file diff --git a/magdamock/src/test/java/be/vlaanderen/vip/mock/magda/client/GeefDossierHandicapByDateTest.java b/magdamock/src/test/java/be/vlaanderen/vip/mock/magda/client/GeefDossierHandicapByDateTest.java new file mode 100644 index 00000000..a456cc4b --- /dev/null +++ b/magdamock/src/test/java/be/vlaanderen/vip/mock/magda/client/GeefDossierHandicapByDateTest.java @@ -0,0 +1,99 @@ +package be.vlaanderen.vip.mock.magda.client; + +import be.vlaanderen.vip.magda.client.diensten.GeefDossierHandicapByDateRequest; +import be.vlaanderen.vip.mock.magda.client.legallogging.ClientLogServiceMock; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; + +import java.time.LocalDate; +import java.util.Set; + +import static org.assertj.core.api.Assertions.assertThat; + +@Slf4j +class GeefDossierHandicapByDateTest extends MockTestBase { + @Test + @SneakyThrows + void geefDossierHandicapByDateGeeftAntwoord() { + final var requestInsz = "88681575651"; + var request = GeefDossierHandicapByDateRequest.builder() + .insz(requestInsz) + .referenceDate(LocalDate.of(2023, 1, 1)) + .sources(Set.of( + GeefDossierHandicapByDateRequest.HandicapAuthenticSourceType.DGPH + )) + .parts(Set.of( + GeefDossierHandicapByDateRequest.HandicapFilePartType.SOCIAL_CARDS + )) + .build(); + + var clientLogService = new ClientLogServiceMock(); + + var connector = makeMagdaConnector(clientLogService); + + var antwoord = connector.send(request); + log.info("{}", antwoord.getDocument()); + + assertThat(antwoord.isBodyFilledIn()).isTrue(); + assertThat(antwoord.isHasContents()).isTrue(); + assertThat(antwoord.getUitzonderingEntries()).isEmpty(); + assertThat(antwoord.getResponseUitzonderingEntries()).isEmpty(); + + assertThat(clientLogService.getNumberOfMagdaLoggedRequests()).isEqualTo(1); + assertThat(clientLogService.getNumberOfSucceededLoggedRequests()).isEqualTo(1); + assertThat(clientLogService.getNumberOfFailedLoggedRequests()).isZero(); + + var doc = antwoord.getDocument(); + + var referte = doc.getValue("//Antwoorden/Antwoord/Referte"); + assertThat(referte).isEqualTo(request.getRequestId().toString()); + + var status = doc.getValue("//Antwoorden/Antwoord/Inhoud/ConsultFilesByDateResponse/status/value"); + assertThat(status).isEqualTo("DATA_FOUND"); + + var ssin = doc.getValue("//Antwoorden/Antwoord/Inhoud/ConsultFilesByDateResponse/ssin"); + assertThat(ssin).isEqualTo("88681575651"); + } + + @Test + @SneakyThrows + void geefDossierHandicapByDateGeeftAntwoordNotFound() { + final var requestInsz = "00010100173"; + var request = GeefDossierHandicapByDateRequest.builder() + .insz(requestInsz) + .referenceDate(LocalDate.of(2023, 1, 1)) + .sources(Set.of( + GeefDossierHandicapByDateRequest.HandicapAuthenticSourceType.DGPH + )) + .parts(Set.of( + GeefDossierHandicapByDateRequest.HandicapFilePartType.SOCIAL_CARDS + )) + .build(); + + var clientLogService = new ClientLogServiceMock(); + + var connector = makeMagdaConnector(clientLogService); + + var antwoord = connector.send(request); + log.info("{}", antwoord.getDocument()); + + assertThat(antwoord.isBodyFilledIn()).isTrue(); + assertThat(antwoord.isHasContents()).isTrue(); + + assertThat(clientLogService.getNumberOfMagdaLoggedRequests()).isEqualTo(1); + assertThat(clientLogService.getNumberOfSucceededLoggedRequests()).isEqualTo(1); + assertThat(clientLogService.getNumberOfFailedLoggedRequests()).isZero(); + + var doc = antwoord.getDocument(); + + var referte = doc.getValue("//Antwoorden/Antwoord/Referte"); + assertThat(referte).isEqualTo(request.getRequestId().toString()); + + var status = doc.getValue("//Antwoorden/Antwoord/Inhoud/ConsultFilesByDateResponse/status/value"); + assertThat(status).isEqualTo("NO_DATA_FOUND"); + + var ssin = doc.getValue("//Antwoorden/Antwoord/Inhoud/ConsultFilesByDateResponse/ssin"); + assertThat(ssin).isEqualTo("00010100173"); + } +} diff --git a/magdamock/src/test/java/be/vlaanderen/vip/mock/magda/client/simulators/GeefDossierHandicapSimulatorTest.java b/magdamock/src/test/java/be/vlaanderen/vip/mock/magda/client/simulators/GeefDossierHandicapSimulatorTest.java new file mode 100644 index 00000000..735af29e --- /dev/null +++ b/magdamock/src/test/java/be/vlaanderen/vip/mock/magda/client/simulators/GeefDossierHandicapSimulatorTest.java @@ -0,0 +1,61 @@ +package be.vlaanderen.vip.mock.magda.client.simulators; + +import be.vlaanderen.vip.mock.magda.MagdaDocumentBuilder; +import be.vlaanderen.vip.mock.magda.inventory.ResourceFinders; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.Map; + +import static be.vlaanderen.vip.mock.magda.client.simulators.SOAPSimulatorBuilder.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +class GeefDossierHandicapSimulatorTest { + + @Test + void fillsInSsinFromByDateRequest() throws URISyntaxException, IOException { + var ssin = "00010100173"; + + var request = MagdaDocumentBuilder.request(Map.of( + "Context", Map.of( + "Naam", "GeefDossierHandicap", + "Versie", "03.00.0000"), + "Vragen", Map.of( + "Vraag", Map.of( + "Inhoud", Map.of( + "Criteria", Map.of( + "ConsultFilesByDateCriteria", Map.of( + "ssin", ssin + ))))))); + + var simulator = new GeefDossierHandicapSimulator(ResourceFinders.magdaSimulator(), PERSOON, KEY_SSIN); + + var response = simulator.send(request); + + assertEquals(ssin, response.getValue("//Antwoorden/Antwoord/Inhoud/ConsultFilesByDateResponse/ssin")); + } + + @Test + void fillsInSsinFromByPeriodRequest() throws URISyntaxException, IOException { + var ssin = "00010100173"; + + var request = MagdaDocumentBuilder.request(Map.of( + "Context", Map.of( + "Naam", "GeefDossierHandicap", + "Versie", "03.00.0000"), + "Vragen", Map.of( + "Vraag", Map.of( + "Inhoud", Map.of( + "Criteria", Map.of( + "ConsultFilesByPeriodCriteria", Map.of( + "ssin", ssin + ))))))); + + var simulator = new GeefDossierHandicapSimulator(ResourceFinders.magdaSimulator(), PERSOON, KEY_SSIN); + + var response = simulator.send(request); + + assertEquals(ssin, response.getValue("//Antwoorden/Antwoord/Inhoud/ConsultFilesByPeriodResponse/ssin")); + } +} \ No newline at end of file diff --git a/magdamock/src/test/resources/simulator_xsd/SocZek.GeefDossierHandicapDienst-03.00/WebService/GeefDossierHandicapResponse.xsd b/magdamock/src/test/resources/simulator_xsd/SocZek.GeefDossierHandicapDienst-03.00/WebService/GeefDossierHandicapResponse.xsd new file mode 100644 index 00000000..8214d990 --- /dev/null +++ b/magdamock/src/test/resources/simulator_xsd/SocZek.GeefDossierHandicapDienst-03.00/WebService/GeefDossierHandicapResponse.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/magdaservice/pom.xml b/magdaservice/pom.xml index 65ec54ae..494489bb 100644 --- a/magdaservice/pom.xml +++ b/magdaservice/pom.xml @@ -5,7 +5,7 @@ magda be.vlaanderen.vip.mock - 2.13.0 + 2.14.0 4.0.0 diff --git a/pom.xml b/pom.xml index de882bb5..ff497920 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ be.vlaanderen.vip.mock magda - 2.13.0 + 2.14.0 magdaservice MAGDA diensten Mock voor afnemers diff --git a/signing/pom.xml b/signing/pom.xml index 2277cd01..c0ac064e 100644 --- a/signing/pom.xml +++ b/signing/pom.xml @@ -5,7 +5,7 @@ magda be.vlaanderen.vip.mock - 2.13.0 + 2.14.0 4.0.0 diff --git a/tester/pom.xml b/tester/pom.xml index cf8921df..5c7543cb 100644 --- a/tester/pom.xml +++ b/tester/pom.xml @@ -5,7 +5,7 @@ magda be.vlaanderen.vip.mock - 2.13.0 + 2.14.0 4.0.0