-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
163 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Onboarding Adapter Mock | ||
|
||
Mock of onboarding adapter using [WireMock]. | ||
|
||
## Run | ||
|
||
**NOTE**: Before the first usage of the standalone [WireMock] please execute the following command: | ||
|
||
```bash | ||
mvn clean package | ||
``` | ||
|
||
You can start [WireMock] using the predefined script: | ||
|
||
```bash | ||
./bin/wiremock.sh | ||
``` | ||
|
||
[WireMock]: https://wiremock.org/docs/) |
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,10 @@ | ||
#!/bin/bash | ||
|
||
mydir=`dirname $0` | ||
cd $mydir/.. | ||
|
||
java -jar target/dependency/wiremock-jre8-standalone.jar \ | ||
--port 8090 \ | ||
--root-dir "src/test/wiremock" \ | ||
--verbose \ | ||
--global-response-templating |
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,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ PowerAuth Enrollment Server | ||
~ Copyright (C) 2022 Wultra s.r.o. | ||
~ | ||
~ This program is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU Affero General Public License as published | ||
~ by the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU Affero General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU Affero General Public License | ||
~ along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.wultra.security</groupId> | ||
<artifactId>enrollment-server-parent</artifactId> | ||
<version>1.4.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>enrollment-server-onboarding-adapter-mock</artifactId> | ||
<name>enrollment-server-onboarding-adapter-mock</name> | ||
<description>Onboarding adapter mock for enrollment server.</description> | ||
|
||
<properties> | ||
<wiremock.version>2.33.2</wiremock.version> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-wiremock</id> | ||
<goals> | ||
<goal>copy</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>com.github.tomakehurst</groupId> | ||
<artifactId>wiremock-jre8-standalone</artifactId> | ||
<version>${wiremock.version}</version> | ||
</artifactItem> | ||
</artifactItems> | ||
<stripVersion>true</stripVersion> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
8 changes: 8 additions & 0 deletions
8
...llment-server-onboarding-adapter-mock/src/test/wiremock/__files/body-client-evaluate.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,8 @@ | ||
{ | ||
"result": "OK", | ||
"info": { | ||
"aggregationResult": true, | ||
"mdcCheck": true, | ||
"documentsAccepted": true | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...llment-server-onboarding-adapter-mock/src/test/wiremock/__files/body-consent-storage.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 @@ | ||
{} |
3 changes: 3 additions & 0 deletions
3
enrollment-server-onboarding-adapter-mock/src/test/wiremock/__files/body-consent-text.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,3 @@ | ||
{ | ||
"consentText": "<html><body><h1>Lorem ipsum</h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam posuere lacus quis dolor. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Nullam at arcu a est sollicitudin euismod. Aliquam in lorem sit amet leo accumsan lacinia. Duis condimentum augue id magna semper rutrum. Sed convallis magna eu sem. Pellentesque arcu. Phasellus faucibus molestie nisl. Maecenas fermentum, sem in pharetra pellentesque, velit turpis volutpat ante, in pharetra metus odio a lectus. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</body></html>" | ||
} |
3 changes: 3 additions & 0 deletions
3
enrollment-server-onboarding-adapter-mock/src/test/wiremock/__files/body-otp-send.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,3 @@ | ||
{ | ||
"otpSent": true | ||
} |
4 changes: 4 additions & 0 deletions
4
enrollment-server-onboarding-adapter-mock/src/test/wiremock/__files/body-user-lookup.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,4 @@ | ||
{ | ||
"userId": "mockuser_{{jsonPath request.body '$.identification.clientNumber'}}", | ||
"consentRequired": true | ||
} |
10 changes: 10 additions & 0 deletions
10
enrollment-server-onboarding-adapter-mock/src/test/wiremock/mappings/client-evaluate.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,10 @@ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"url": "/client/evaluate" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"bodyFileName": "body-client-evaluate.json" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
enrollment-server-onboarding-adapter-mock/src/test/wiremock/mappings/consent-storage.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,10 @@ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"url": "/consent/storage" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"bodyFileName": "body-consent-storage.json" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
enrollment-server-onboarding-adapter-mock/src/test/wiremock/mappings/consent-text.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,10 @@ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"url": "/consent/text" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"bodyFileName": "body-consent-text.json" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
enrollment-server-onboarding-adapter-mock/src/test/wiremock/mappings/otp-send.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,10 @@ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"url": "/otp/send" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"bodyFileName": "body-otp-send.json" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
enrollment-server-onboarding-adapter-mock/src/test/wiremock/mappings/user-lookup.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,10 @@ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"url": "/user/lookup" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"bodyFileName": "body-user-lookup.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