When cloning the project to a Windows machine, make sure to add the flag
--config core.autocrlf=input
to ensure that linebreaks are preserved correctly in the shell scripts (Thanks Jonathan)
The integrations tests must be skipped because, they need various java and .net WSPs running. So to build locally do:
mvn clean install -DskipTests
The swing application can be run from Idea. Ensure that the workspace is set to D:\Projects\OIOIDWS.Java\examples\oio-idws-soap\signature-scenario subfolder (talking your specific repo).
To make a successfull run you need to:
- Start the service-bearer service in a prompt (or from the maven plugin in Idea if you want to debug the service)
examples/oio-idws-soap/service-bearer> mvn clean install tomcat7:run-war
- Start the application by right-clicking examples/oio-idws-soap/signature-scenario/src/main/java/client/Application.java in Idea and selecting run Application.main.
- Click load
Open Keystore
and selectexamples/oioidwsmoces.p12
. Enter passwordTest1234
- Click
Run
- Observe the following output in the Application:
Loaded keystore Invoked service Response from service: Hello John Response from service: Hello Jane
The unit test resembles the application behavior. It also needs the service-bearer service to be running.
If the unit test and/or application does not work. One of the following things might be the reason:
Update STS certificate
The latest STS certificate must be present in
examples/oio-idws-soap/signature-scenario/src/main/resources/trust.jks
and in
examples/oio-idws-soap/service-bearer/src/main/resources/trust.jks
.
Use java keytool to check the alias sts
in the keystores
To delete the old do:
cd <project with old sts certificate>
/c/tools/openjdk-8u232-b09/bin/keytool.exe -delete -alias sts -keystore src/main/resources/trust.jks -v
To import the new do:
cd <project with old sts certificate>
/c/tools/openjdk-8u232-b09/bin/keytool.exe -import -alias sts -file sts.cer -keystore src/main/resources/trust.jks
The latest certificate can be downloaded from https://tu.nemlog-in.dk/oprettelse-og-administration-af-tjenester/security-token-service/hjaelp.og.vejledning/integrationstest/
Ensure service certificate trust in client
The certificate in examples/oio-idws-soap/service-bearer/src/main/resources/service.pfx
must be present in examples/oio-idws-soap/signature-scenario/src/main/resources/trust.jks
To export the certificate from service.pfx do (do keytool list to check if the alias has changed first)
cd service-bearer
/c/tools/openjdk-8u232-b09/bin/keytool.exe -export -alias "eid java test (funktionscertifikat)" -file eid.cer -keystore src/main/resources/service.pfx
To import the certificate into
cd signature-scenario
/c/tools/openjdk-8u232-b09/bin/keytool.exe -import -alias "eid java test (funktionscertifikat)" -file eid.cer -keystore src/main/resources/trust.jks
mvn clean install
in root folder
cd examples/oio-idws-soap/service-hok
mvn tomcat7:run-war
in another terminal: goto folder
cd integrationtest\system-user-java
mvn test
stop the service-hok from before
In the OIOIDWS.dotnet project start the Digst.OioIdws.WspExample
goto folder
cd integrationtest\system-user-dotnet
mvn test
cd examples/oio-idws-soap/service-bearer
mvn tomcat7:run-war
in another terminal
cd integrationtest\signature-scenario-java
mvn test
stop the service-bearer from above
cd examples/oio-idws-rest/rest-service
mvn spring-boot:run
In the OIOIDWS.dotnet project start the Digst.OioIdws.Rest.Examples.ServerAndASCombined
in another terminal
cd integrationtest\rest-signature
mvn test -Dtest=signature.RestSignatureScenarioJavaTest
mvn test -Dtest=signature.RestSignatureScenarioDotnetTest
(you need to run the tests separately since the WSC uses the same port in both tests)
stop the Java and .Net REST WSPs
NB! Currently you need to enter the password for the MOCES certificate, since it runs against int test with no Test Login.
Because of this it is currently ignored, so you need to comment out the @Ignore
statement in the TestBootstrapScenario_IntTest()
method of the integrationtest/bootstrap/src/test/java/soap/BootstrapIntegrationTest.java class.
cd examples/oio-idws-soap/service-hok
mvn tomcat7:run-war
In the OIOIDWS.dotnet project start the Digst.OioIdws.WspExample
cd examples/oio-idws-soap/bootstrap-scenario
mvn tomcat7:run-war
in another terminal
cd integrationtest\boostrap
mvn test
NB! The tests are not fully automated yet, so you need to enter the password manually in the GUI.
stop the Java and .Net WSPs
NB! Currently you need to enter the password for the MOCES certificate, since it runs against int test with no Test Login.
Because of this it is currently ignored, so you need to comment out the @Ignore
statement in the RestBootstrapScenarioDotnetTest
and RestBootstrapScenarioJavaTest
method of the integrationtest/bootstrap/src/test/java/soap/BootstrapIntegrationTest.java class.
cd examples/oio-idws-rest/rest-service
mvn spring-boot:run
In the OIOIDWS.dotnet project start the Digst.OioIdws.Rest.Examples.ServerAndASCombined
in another terminal
cd integrationtest\rest-bootstrap
mvn test -Dtest=bootstrap.RestBootstrapScenarioJavaTest
mvn test -Dtest=bootstrap.RestBootstrapScenarioDotnetTest
(you need to run the tests separately since the WSC uses the same port in both tests)
stop the Java and .Net REST WSPs