Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbucket-pipelines committed Sep 23, 2024
2 parents f8beecf + 066999e commit 9cb3bb1
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.49.0</version>
<version>2.50.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion interfaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.49.0</version>
<version>2.50.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public ConnectorMagdaClient(MagdaConnector connector) {
@Override
protected void validateMagdaResponse(MagdaResponse response, MagdaRequest request) throws MagdaClientException {
if(!response.getUitzonderingEntries().isEmpty()) {
throw new MagdaClientException("Level 2 exception occurred while calling magda service", new UitzonderingenSectionInResponseException(request.getSubject(), response.getUitzonderingEntries(), request.getCorrelationId(), response.getRequestId()));
throw new MagdaClientException("Level 2 exception occurred while calling magda service", new UitzonderingenSectionInResponseException(request.getSubject(), response.getUitzonderingEntries(), request.magdaServiceIdentification(), request.getCorrelationId(), response.getRequestId()));
}
if(!response.getResponseUitzonderingEntries().isEmpty() && haveAtLeastOneFout(response.getResponseUitzonderingEntries())) {
throw new MagdaClientException("Level 3 exception occurred while calling magda service", new UitzonderingenSectionInResponseException(request.getSubject(), response.getResponseUitzonderingEntries(), request.getCorrelationId(), response.getRequestId()));
throw new MagdaClientException("Level 3 exception occurred while calling magda service", new UitzonderingenSectionInResponseException(request.getSubject(), response.getResponseUitzonderingEntries(), request.magdaServiceIdentification(), request.getCorrelationId(), response.getRequestId()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public LenientConnectorMagdaClient(MagdaConnector connector) {
@Override
protected void validateMagdaResponse(MagdaResponse response, MagdaRequest request) throws MagdaClientException {
if(!response.getUitzonderingEntries().isEmpty()) {
throw new MagdaClientException("Level 2 exception occurred while calling magda service", new UitzonderingenSectionInResponseException(request.getSubject(), response.getUitzonderingEntries(), request.getCorrelationId(), response.getRequestId()));
throw new MagdaClientException("Level 2 exception occurred while calling magda service", new UitzonderingenSectionInResponseException(request.getSubject(), response.getUitzonderingEntries(), request.magdaServiceIdentification(), request.getCorrelationId(), response.getRequestId()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@
import lombok.Getter;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;

/**
* An identifier of a specific service provided by MAGDA, which comprises a name and a version.
*/
@Getter
@EqualsAndHashCode
@ToString
@AllArgsConstructor
public class MagdaServiceIdentification {
public class MagdaServiceIdentification implements Serializable {

@Serial
private static final long serialVersionUID = 5966457937074564979L;

private String name;
private String version;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private void validateResponse(MagdaResponse response, GeefHistoriekInschrijvingR
if(response.getResponseUitzonderingEntries().stream().anyMatch(x ->
x.getUitzonderingType().equals(UitzonderingType.FOUT) &&
!"30101".equals(x.getIdentification()))) {
throw new MagdaClientException("Level 3 exception occurred while calling magda service", new UitzonderingenSectionInResponseException(request.getSubject(), response.getResponseUitzonderingEntries(), request.getCorrelationId(), response.getRequestId()));
throw new MagdaClientException("Level 3 exception occurred while calling magda service", new UitzonderingenSectionInResponseException(request.getSubject(), response.getResponseUitzonderingEntries(), request.magdaServiceIdentification(), request.getCorrelationId(), response.getRequestId()));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package be.vlaanderen.vip.magda.exception;

import be.vlaanderen.vip.magda.client.MagdaServiceIdentification;
import be.vlaanderen.vip.magda.client.diensten.subject.SubjectIdentificationNumber;
import be.vlaanderen.vip.magda.legallogging.model.UitzonderingEntry;
import lombok.Getter;
Expand All @@ -20,10 +21,17 @@ public class UitzonderingenSectionInResponseException extends ServerException {

private final SubjectIdentificationNumber subject;
private final transient List<UitzonderingEntry> uitzonderingEntries;
private final MagdaServiceIdentification magdaServiceIdentification;

public UitzonderingenSectionInResponseException(SubjectIdentificationNumber subject, List<UitzonderingEntry> uitzonderingEntries, UUID correlationID, UUID requestID) {
public UitzonderingenSectionInResponseException(SubjectIdentificationNumber subject, List<UitzonderingEntry> uitzonderingEntries, MagdaServiceIdentification magdaServiceIdentification, UUID correlationID, UUID requestID) {
super("Backend error '" + uitzonderingEntries.get(0).toString() + "'", correlationID, requestID);
this.subject = subject;
this.uitzonderingEntries = uitzonderingEntries;
this.magdaServiceIdentification = magdaServiceIdentification;
}

@Deprecated(forRemoval = true)
public UitzonderingenSectionInResponseException(SubjectIdentificationNumber subject, List<UitzonderingEntry> uitzonderingEntries, UUID correlationID, UUID requestID) {
this(subject, uitzonderingEntries, null, correlationID, requestID);
}
}
}
2 changes: 1 addition & 1 deletion magdaconnector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.49.0</version>
<version>2.50.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public MagdaResponse send(MagdaRequest magdaRequest, UUID requestId) throws Serv
.log("Result of request to MAGDA service with reference [{}] ({} ms): {}", requestId, duration.toMillis(), uitzonderingenMessage1);

if(!antwoord.isHasContents() && antwoordUitzonderingen.isEmpty() && uitzonderingen.isEmpty()) {
throw new UitzonderingenSectionInResponseException(magdaRequest.getSubject(), getLevel1UitzonderingEntry(response), magdaRequest.getCorrelationId(), requestId);
throw new UitzonderingenSectionInResponseException(magdaRequest.getSubject(), getLevel1UitzonderingEntry(response), magdaRequest.magdaServiceIdentification(), magdaRequest.getCorrelationId(), requestId);
}

return antwoord;
Expand Down
2 changes: 1 addition & 1 deletion magdamock-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.49.0</version>
<version>2.50.0</version>
</parent>
<artifactId>magdamock-starter</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion magdamock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.49.0</version>
<version>2.50.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion magdaservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.49.0</version>
<version>2.50.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>be.vlaanderen.vip.mock</groupId>
<artifactId>magda</artifactId>
<version>2.49.0</version>
<version>2.50.0</version>
<name>magdaservice</name>
<description>MAGDA diensten Mock voor afnemers</description>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion signing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.49.0</version>
<version>2.50.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion tester/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.49.0</version>
<version>2.50.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down

0 comments on commit 9cb3bb1

Please sign in to comment.