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 Mar 26, 2024
2 parents b3a23d9 + 23d21fe commit 1d08bff
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 20 deletions.
15 changes: 12 additions & 3 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ definitions:
name: Publish to Sigrid
script:
- timeout 10m sigridci.py --customer $SIGRID_CI_ACCOUNT --system "Solid" --subsystem $(echo "magdamock.service"| sed -e "s/\./-/g") --source . --publish --include-history
- step: &dependencyTree
name: Dependency tree
caches:
- maven
script:
- mvn dependency:tree > maven.tree
- step: &sigridCI
image: softwareimprovementgroup/sigridci
name: Sigrid CI
Expand All @@ -89,9 +95,6 @@ clone:
depth: full

pipelines:
default:
- step:
<<: *build
branches:
master:
- parallel:
Expand All @@ -107,6 +110,8 @@ pipelines:
- mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout > target/pom_version
artifacts:
- target/pom_version
- step:
<<: *dependencyTree
- step:
<<: *sigridPublish
- step:
Expand Down Expand Up @@ -145,6 +150,8 @@ pipelines:
artifacts:
- "**/*.jar"
- target/pom_version
- step:
<<: *dependencyTree
- step:
<<: *sigridPublish
- step:
Expand Down Expand Up @@ -198,6 +205,8 @@ pipelines:
- mvn -B -U clean verify sonar:sonar -s .m2/settings.xml -Dbuild=bitbucket -Dsonar.host.url=${SONAR_HOST} -Dsonar.projectKey=${SONAR_PROJECT} -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name="$BITBUCKET_BRANCH"
artifacts:
- "**/*.jar"
- step:
<<: *dependencyTree
- step:
<<: *sigridCI
custom:
Expand Down
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.12.0</version>
<version>2.13.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.12.0</version>
<version>2.13.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public class NoResponseException extends ServerException {
private final UUID transactionID;
private final UUID localTransactionID;
private final String serviceName;
private final int statusCode;

public NoResponseException(String bericht, Throwable oorzaak, MagdaRequest magdaRequest) {
public NoResponseException(String bericht, Throwable oorzaak, MagdaRequest magdaRequest, int statusCode) {
super(bericht, oorzaak);
this.transactionID = magdaRequest.getCorrelationId();
this.localTransactionID = magdaRequest.getRequestId();
this.serviceName = magdaRequest.magdaServiceIdentification().getName();
this.statusCode = statusCode;
}
}
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.12.0</version>
<version>2.13.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public MagdaResponse send(MagdaRequest magdaRequest) throws ServerException {
} catch (MagdaConnectionException e) {
logNoResponse(magdaRequest);

throw new NoResponseException("No response", e, magdaRequest);
throw new NoResponseException("No response", e, magdaRequest, e.getStatusCode());
} finally {
CorrelationId.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,36 +84,39 @@ void sendDocumentReturnsNull() {

@Test
void requestFails() throws MagdaConnectionException {
when(connection.sendDocument(any())).thenThrow(new MagdaConnectionException("something went wrong"));
when(connection.sendDocument(any())).thenThrow(new MagdaConnectionException("something went wrong", 500));

var req = GeefBewijsRequest.builder()
.insz("test-insz")
.build();

assertThrows(NoResponseException.class, () -> connector.send(req));
NoResponseException noResponseException = assertThrows(NoResponseException.class, () -> connector.send(req));
assertEquals(noResponseException.getStatusCode(), 500);
}

@Test
void logsRequest() throws MagdaConnectionException {
when(connection.sendDocument(any())).thenThrow(new MagdaConnectionException("something went wrong"));
when(connection.sendDocument(any())).thenThrow(new MagdaConnectionException("something went wrong", 500));

var req = GeefBewijsRequest.builder()
.insz("test-insz")
.build();

assertThrows(NoResponseException.class, () -> connector.send(req));
NoResponseException noResponseException = assertThrows(NoResponseException.class, () -> connector.send(req));
assertEquals(noResponseException.getStatusCode(), 500);
verify(logService).logMagdaRequest(any());
}

@Test
void logsNoReply() throws MagdaConnectionException {
when(connection.sendDocument(any())).thenThrow(new MagdaConnectionException("something went wrong"));
when(connection.sendDocument(any())).thenThrow(new MagdaConnectionException("something went wrong", 500));

var req = GeefBewijsRequest.builder()
.insz("test-insz")
.build();

assertThrows(NoResponseException.class, () -> connector.send(req));
NoResponseException noResponseException = assertThrows(NoResponseException.class, () -> connector.send(req));
assertEquals(noResponseException.getStatusCode(), 500);
verify(logService).logUnansweredRequest(any());
}
}
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.12.0</version>
<version>2.13.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.12.0</version>
<version>2.13.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.12.0</version>
<version>2.13.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.12.0</version>
<version>2.13.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.12.0</version>
<version>2.13.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.12.0</version>
<version>2.13.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down

0 comments on commit 1d08bff

Please sign in to comment.