Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ jdk_8_maven/em/external/rest/spring-batch-rest/target
/jdk_17_maven/em/external/rest/ohsome-api/target/

/jdk_17_maven/cs/rest/spring-rest-example/target/
/jdk_17_maven/cs/rest/digitalbanking/target/
/jdk_17_maven/em/embedded/rest/digitalbanking/target/
/jdk_17_maven/em/external/rest/digitalbanking/target/
/jdk_17_maven/em/embedded/rest/spring-rest-example/target/
/jdk_17_maven/em/external/rest/spring-rest-example/target/

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ How to setup authentication information, based on the current content of the ini
Auth configuration files can found in the [auth](auth) folder.


### REST: Java/Kotlin (39)
### REST: Java/Kotlin (40)

* **Bibliothek** (MIT), [jdk_17_gradle/cs/rest/bibliothek](jdk_17_gradle/cs/rest/bibliothek), from [https://github.com/PaperMC/bibliothek](https://github.com/PaperMC/bibliothek)

Expand All @@ -97,6 +97,8 @@ Auth configuration files can found in the [auth](auth) folder.

* **CWA-Verification-Server** (Apache), [jdk_11_maven/cs/rest/cwa-verification-server](jdk_11_maven/cs/rest/cwa-verification-server), from [https://github.com/corona-warn-app/cwa-verification-server](https://github.com/corona-warn-app/cwa-verification-server)

* **Digital Banking** (not-known license), [jdk_17_maven/cs/rest/digitalbanking](jdk_17_maven/cs/rest/digitalbanking), from [https://github.com/jphaugla/Redisearch-Digital-Banking-redisTemplate](https://github.com/jphaugla/Redisearch-Digital-Banking-redisTemplate)

* **ERC20 Rest Service** (not-known license), [jdk_8_gradle/cs/rest/erc20-rest-service](jdk_8_gradle/cs/rest/erc20-rest-service), from [https://github.com/web3labs/erc20-rest-service](https://github.com/web3labs/erc20-rest-service)

* **Familie Ba Sak** (MIT), [jdk_17_maven/cs/rest/familie-ba-sak](jdk_17_maven/cs/rest/familie-ba-sak), from [https://github.com/navikt/familie-ba-sak](https://github.com/navikt/familie-ba-sak)
Expand Down Expand Up @@ -268,6 +270,10 @@ _Black-box_ testing: you can build all the SUTs via Docker using `scripts/dist-
docker-compose -f dockerfiles/reservations-api.yaml up
```

Note: for `digitalbanking`, run the fuzzer with `--endpointExclude "/generateData"`.
That endpoint loops on its request parameters with no upper bound, and a large value makes the SUT unresponsive for the rest of the experiment.
The white-box drivers already skip it.

_White-box_ testing: everything can be setup by running the script `scripts/dist.py`.
Note that you will need installed at least Maven, Gradle, JDK 8, JDK 11, JDK 17, JDK 21, JDK 25, NPM, as well as Docker.
Also, you will need to setup environment variables like `JAVA_HOME_8`, `JAVA_HOME_11`, `JAVA_HOME_17`, `JAVA_HOME_21` and `JAVA_HOME_25`.
Expand Down
13 changes: 13 additions & 0 deletions dockerfiles/digitalbanking.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM amazoncorretto:17-alpine-jdk

COPY ./dist/digitalbanking-sut.jar .
COPY ./dist/jacocoagent.jar .




ENTRYPOINT \
java \
-javaagent:jacocoagent.jar=output=tcpserver,address=*,port=6300,append=false,dumponexit=false \
-jar digitalbanking-sut.jar \
--server.port=8080 --REDIS_HOST=db --REDIS_PORT=6379 --REDIS_PASSWORD=jasonrocks --redis.host=db --redis.port=6379 --KAFKA_HOST=kafka --KAFKA_PORT=9092 --SPRING_CASSANDRA_HOST=cassandra --SPRING_CASSANDRA_PORT=9042 --SPRING_CASSANDRA_CLUSTER=test --SPRING_CASSANDRA_DATACENTER=datacenter1
70 changes: 70 additions & 0 deletions dockerfiles/digitalbanking.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
services:
mitmproxy:
image: mitmproxy/mitmproxy:10.2.4
user: "0:0"
environment:
MITM_LOG_DIR: /custom-logs
MITM_LOG_FILE: ${MITM_LOG_FILE:-minlog.csv}
command: >
mitmdump
--mode reverse:http://sut-digitalbanking:8080
--listen-host 0.0.0.0
--listen-port 8080
--set keep_host_header=true
-s /addons/minlog.py
volumes:
- ${HOST_LOG_DIR:-./mitm-logs}:/custom-logs
- ./addons:/addons:ro
ports:
- "${HOST_PORT:-8080}:8080"
depends_on:
- sut-digitalbanking
sut-digitalbanking:
build:
dockerfile: ./dockerfiles/digitalbanking.dockerfile
context: ..
environment:
AUTH_PORT: ${AUTH_PORT:-8081}
ports:
- "${JACOCO_PORT:-6300}:6300"
depends_on:
db:
condition: service_healthy
cassandra:
condition: service_healthy
db:
image: redis/redis-stack-server:7.4.0-v1
environment:
REDIS_ARGS: --requirepass jasonrocks
healthcheck:
test: redis-cli -a jasonrocks ping | grep PONG
interval: 30s
timeout: 30s
retries: 3
cassandra:
image: cassandra:4.1
environment:
CASSANDRA_CLUSTER_NAME: test
CASSANDRA_DC: datacenter1
CASSANDRA_ENDPOINT_SNITCH: SimpleSnitch
HEAP_NEWSIZE: 128M
MAX_HEAP_SIZE: 512M
healthcheck:
test: cqlsh -e "CREATE KEYSPACE IF NOT EXISTS banking WITH replication = {'class':'SimpleStrategy','replication_factor':1};CREATE TABLE IF NOT EXISTS banking.transaction (tranid text, accountno text, amounttype text, merchant text, referencekeytype text, referencekeyvalue text, originalamount text, amount text, trancd text, description text, initialdate text, settlementdate text, postingdate text, status text, disputeid text, transactionreturn text, location text, transactiontags text, primary key (tranid));"
interval: 30s
timeout: 30s
retries: 3
kafka:
image: apache/kafka:3.8.1
environment:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
1 change: 1 addition & 0 deletions experiments/wb-exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def __init__(self, name, platform):
Sut("catwatch", JDK_8),
Sut("commafeed", JDK_25),
Sut("cwa-verification", JDK_11),
Sut("digitalbanking", JDK_17),
Sut("erc20-rest-service", JDK_8),
Sut("familie-ba-sak",JDK_17),
Sut("features-service", JDK_8),
Expand Down
8 changes: 8 additions & 0 deletions jdk_17_maven/cs/rest/digitalbanking/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- MODIFIED-->
<!-- WFD expects a single self-contained "digitalbanking-sut.jar". The classifier keeps
the plain jar as the main artifact, which the embedded driver depends on. -->
<configuration>
<finalName>digitalbanking</finalName>
<classifier>sut</classifier>
</configuration>
<!-- MODIFIED-->
</plugin>
</plugins>
</build>
Expand Down
1 change: 1 addition & 0 deletions jdk_17_maven/cs/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<module>tiltaksgjennomforing</module>
<module>ohsome-api</module>
<module>spring-rest-example</module>
<module>digitalbanking</module>


<!-- TODO: need to solve issue with Google OAuth2 -->
Expand Down
59 changes: 59 additions & 0 deletions jdk_17_maven/em/embedded/rest/digitalbanking/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>

<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>

<artifactId>evomaster-benchmark-jdk17-em-embedded-rest-digitalbanking</artifactId>
<packaging>jar</packaging>

<parent>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-benchmark-jdk17-em-embedded-rest</artifactId>
<version>4.3.1-SNAPSHOT</version>
</parent>

<!-- Embedded mode puts the SUT and the driver on one classpath, and the SUT's parent pom does
not apply here. Without this import, transitive dependencies win instead (eg testcontainers'
slf4j-api 1.7 replaces the 2.x Spring Boot 3.1 needs). -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.1.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- The SUT as a library -->
<dependency>
<groupId>com.jphaugla</groupId>
<artifactId>redis</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>kafka</artifactId>
<version>${testcontainers.version}</version>
<scope>compile</scope>
</dependency>

<!-- To reset the Redis state between tests; same version as the SUT uses -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>4.4.3</version>
</dependency>
</dependencies>

</project>
Loading
Loading