# MOA ZS
## Compile, Test and Package
Compilation and Runtime Requirements:
- openJDK 12 (OpenJDK 11 has an unfixed bug [1] that prevents the completion of TLS handshakes.)
### Run Unit Tests
Command:
```
mvn test
```
### Run Integration Tests
Integration tests start with the prefix `IT`. Note that some integration tests have additional requirements (e.g. ITMsgClientTest also tests the TLS connection and Client Authentication). Ensure that these requirements are met as well.
Command:
```
mvn test -P integration-test
```
#### Quick Guide: Set Up SSL (inc. Client Authentication) in Apache 2.
Some tests in ITMsgClientTest require SSL protection of the service endpoint with SSL Client Authentication. Here's a quick guide how to set up an Apache 2 service on localhost as a SSL terminating reverse proxy to the zusemsg endpoint that runs on http://localhost:8081/ :
1. Install Apache 2.
1. Ensure that mod-proxy is installed and enabled.
1. In `default-ssl.conf` add the following lines to proxy requests from `https://localhost/zusemsg` to `http://localhost:8081`:
```
ProxyRequests off
ProxyPass /zusemsg/ http://localhost:8081/
ProxyPassReverse /zusemsg/ http://localhost:8081/
Order allow,deny
allow from all
```
1. Use certificate and key provided in this repository for the TLS connection and add the following directives to `default-ssl.conf`:
```
SSLCertificateFile /server.localhost.cert.pem
SSLCertificateKeyFile /server.localhost.key.pem
SSLCertificateChainFile /ca-chain.cert.pem
```
1. Trust the client certificate with the following directive in `default-ssl-conf`:
```
SSLCACertificateFile /trusted-cas-bundle.pem
```
## Package to .war
```
mvn clean package
```
Find the war file in the `target/` folder.
# Footnotes
[1] https://bugs.openjdk.java.net/browse/JDK-8214098