Artefact Quick Start

CDS Engineering has produced a number of artefacts that meet the requirements of the Product APIs outlined in Standards 0.9.3.

Desktop Sandbox

Requirements

The Desktop Sandbox is an amalgamation of Docker containers orchestrated using Docker Compose.

To get up and running with the Sandbox you require:
  1. Docker

  2. Docker Compose

Startup

The following command starts up the Desktop Sandbox environment:

user@host:~/git$ git clone https://github.com/consumerdatastandardsaustralia/desktop-sandbox
Cloning into 'desktop-sandbox'...
remote: Enumerating objects: 73, done.
remote: Counting objects: 100% (73/73), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 73 (delta 21), reused 62 (delta 15), pack-reused 0
Unpacking objects: 100% (73/73), done.
user@host:~/git$ cd desktop-sandbox
user@host:~/git/desktop-sandbox$ docker-compose up
Creating network "desktop-sandbox_cdsdevnet" with the default driver
Creating volume "desktop-sandbox_consul-data" with default driver
Creating desktop-sandbox_consul_1 ... done
Creating desktop-sandbox_holder2_1   ... done
Creating desktop-sandbox_discovery_1 ... done
Creating desktop-sandbox_holder1_1   ... done
Attaching to desktop-sandbox_consul_1, desktop-sandbox_discovery_1, desktop-sandbox_holder2_1, desktop-sandbox_holder1_1
consul_1     | bootstrap = true: do not enable unless necessary
consul_1     | ==> Starting Consul agent...
consul_1     | ==> Consul agent running!
consul_1     |            Version: 'v1.5.1'
consul_1     |            Node ID: 'e6617bee-9196-21e6-686a-8652d36c3958'
consul_1     |          Node name: '70308f18d0dc'
consul_1     |         Datacenter: 'dc1' (Segment: '<all>')
consul_1     |             Server: true (Bootstrap: true)
<snip>
holder1_1    | 2019-07-01 07:54:52.862  INFO 44 --- [0.0-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
holder1_1    | 2019-07-01 07:54:52.862  INFO 44 --- [0.0-8081-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
holder1_1    | 2019-07-01 07:54:52.882  INFO 44 --- [0.0-8081-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 20 ms
holder1_1    |     2019/07/01 07:54:53 [INFO] agent: Synced check "service:holder1"
holder2_1    | 2019-07-01 07:54:55.319  INFO 44 --- [0.0-8082-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
holder2_1    | 2019-07-01 07:54:55.319  INFO 44 --- [0.0-8082-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
holder2_1    | 2019-07-01 07:54:55.338  INFO 44 --- [0.0-8082-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 18 ms
holder2_1    |     2019/07/01 07:54:55 [INFO] agent: Synced check "service:holder2"

This will setup services as follows:

  • Data Holder 1 (Good Payloads): http://localhost:8081/cds-au/v1

  • Data Holder 2 (Bad Payloads): http://localhost:8082/cds-au/v1

  • Sandbox Register: http://localhost:9000/cds-register/v1

  • Consul Config Service: http://localhost:8500/ui/dc1/services

Sandbox CLI Access

Once the Sandbox is up and running you can initiate connectivity within the private Sandbox network by executing the CLI container: docker run --network desktop-sandbox_cdsdevnet -it consumerdatastandardsaustralia/cds-client-java-cli:0.9.3-SNAPSHOT --consul.enabled=true --consulmaster=10.252.252.2

user@host:~/$ docker run --network desktop-sandbox_cdsdevnet -it consumerdatastandardsaustralia/cds-client-java-cli:0.9.3-SNAPSHOT --consul.enabled=true --consulmaster=10.252.252.2
 ==> Starting Consul agent...
 <snip>

 #     ___     ___     ___
 #    / __|   |   \   / __|
 #   | (__    | |) |  \__ \
 #    \___|   |___/   |___/
 #  _|"""""|_|"""""|_|"""""|
 #  "`-0-0-'"`-0-0-'"`-0-0-'

 Starting CdsClientShell v0.9.3-SNAPSHOT on d0b751a96b76 with PID 44 (/opt/cds-client-java-cli/cli.jar started by root in /opt)
 No active profile set, falling back to default profiles: default
 Reflections took 302 ms to scan 2 urls, producing 6 keys and 187 values
 Reflections took 107 ms to scan 2 urls, producing 6 keys and 187 values
 Started CdsClientShell in 6.451 seconds (JVM running for 8.533)
 cds-shell:>

Sandbox Register Connection

So that the Sandbox CLI can discover the Holders alive in the Sandbox it is necessary to setup the register-endpoint within CLI as follows:

cds-shell:>set-register-endpoint --discovery-endpoint http://discovery:9000/cds-register/v1
Discovery Endpoint URL is set to: http://discovery:9000/cds-register/v1
cds-shell:>list-holders --summary
+-------------+-------------------------------+
| Provider ID | Endpoint Address              |
+-------------+-------------------------------+
|         GH1 | http://holder1:8081/cds-au/v1 |
+-------------+-------------------------------+
|         BH1 | http://holder2:8082/cds-au/v1 |
+-------------+-------------------------------+
cds-shell:>

Custom Holder Launcher

If you would like to launch your own Holder (with it’s own payloads) into the Sandbox environment you can do so by launching another Docker container with the appropriate parameters.

docker run -h holder3 -p 8083:8080 --network desktop-sandbox_cdsdevnet -v `pwd`/runtime/holder3:/opt/payloads -it consumerdatastandardsaustralia/cds-holder-java:0.9.3-SNAPSHOT --consul.enabled=true --consulmaster=10.252.252.2 --id=holder3 --registry.providerId=NH1

user@host:~$ docker run -h holder3 -p 8083:8080 --network desktop-sandbox_cdsdevnet -v `pwd`/runtime/holder3:/opt/payloads -it consumerdatastandardsaustralia/cds-holder-java:0.9.3-SNAPSHOT --consul.enabled=true --consulmaster=10.252.252.2 --id=holder3 --registry.providerId=NH1
 ==> Starting Consul agent...
 ==> Joining cluster...
     Join completed. Synced with 1 initial agents
  <snip>
 2019-07-01 08:04:08.508  INFO 44 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
 2019-07-01 08:04:08.571  INFO 44 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
 2019-07-01 08:04:08.643  INFO 44 --- [           main] s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
 2019-07-01 08:04:09.199  INFO 44 --- [           main] a.o.c.holder.util.ContextEventListener   : Service setup in progress, performing boot time operations
 2019-07-01 08:04:09.202  INFO 44 --- [           main] a.o.c.holder.util.ContextEventListener   : Initiating data loader for Products
     2019/07/01 08:04:09 [INFO] agent: Synced service "holder3"
 2019-07-01 08:04:10.023  INFO 44 --- [           main] a.o.c.holder.util.HolderRegistrator      : Holder Service registered with Consul server with id of holder3 on port 8080 with type HOLDER and service uri of http://holder3:8080
 2019-07-01 08:04:10.153  INFO 44 --- [           main] a.o.c.holder.util.HolderRegistrator      : Holder Service Discovery payload registered as key value pair with Consul server
 2019-07-01 08:04:10.235  INFO 44 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
 2019-07-01 08:04:10.242  INFO 44 --- [           main] a.o.c.holder.HolderApplication           : Started HolderApplication in 17.08 seconds (JVM running for 18.471)

This Holder will now be available at http://localhost:8083. It will also be registered with the Sandbox Register:

cds-shell:>list-holders --summary
+-------------+-------------------------------+
| Provider ID | Endpoint Address              |
+-------------+-------------------------------+
|         GH1 | http://holder1:8081/cds-au/v1 |
+-------------+-------------------------------+
|         BH1 | http://holder2:8082/cds-au/v1 |
+-------------+-------------------------------+
|         NH1 | http://holder3:8080/cds-au/v1 |
+-------------+-------------------------------+
cds-shell:>get-holder NH1
Register Holder payload retrieved
class RegisterDataHolder {
    providerId: NH1
    accreditation: null
    participant: class RegisterParticipant {
        name: ACME Bank
        participantId: null
        participantType: HOLDER
        organisation: class class au.org.consumerdatastandards.holder.model.CommonOrganisationDetail {
        }
    }
    endpointDetail: [class RegisterDataHolderServiceEndpoint {
        acccDataStandardVersion: 0.9.3
        cdrBaseUri: http://holder3:8080/cds-au/v1
        cdrRevocationUri: null
        cdrCacheRefreshUrl: null
        cdrMetricsUrl: null
        publicUrl: null
        termsofServiceUrl: null
        logoUrl: null
        supportUrl: null
        policyUrl: null
    }]
    authDetail: []
}
cds-shell:>

Client CLI

Requirements

If you wish to simply run the CDS Java Client CLI you only require Docker.

If you wish to build CDS Java Client CLI this requires:

  1. Java 1.8+

  2. Maven

Execution

To start the CDS Client CLI execute the Docker command as below:

docker run -it consumerdatastandardsaustralia/cds-client-java-cli:0.9.3-SNAPSHOT

docker run -it consumerdatastandardsaustralia/cds-client-java-cli:0.9.3-SNAPSHOT

#     ___     ___     ___
#    / __|   |   \   / __|
#   | (__    | |) |  \__ \
#    \___|   |___/   |___/
#  _|"""""|_|"""""|_|"""""|
#  "`-0-0-'"`-0-0-'"`-0-0-'

2019-05-10 04:59:15.066  INFO 1 --- [           main] a.o.c.client.cli.CdsClientShell          : Starting CdsClientShell v0.9.3-SNAPSHOT on b78c5f91f96d with PID 1 (/opt/cds-client-java-cli/cli.jar started by root in /)
2019-05-10 04:59:15.068  INFO 1 --- [           main] a.o.c.client.cli.CdsClientShell          : No active profile set, falling back to default profiles: default
2019-05-10 04:59:15.913  INFO 1 --- [           main] a.o.c.client.cli.CdsClientShell          : Started CdsClientShell in 1.061 seconds (JVM running for 1.314)
cds-shell:>

Manual Build & Run

To manually build the CLI using Maven, run:

user@cds:~/git$ git clone https://github.com/ConsumerDataStandardsAustralia/cds-client-java-cli
user@cds:~/git$ cd cds-client-java-cli
user@cds:~/git/cds-client-java$ mvn clean spring-boot

Client Library

Requirements

Using the CDS Java based Client Library requires:

  1. Java 1.8+

  2. Maven/Gradle

Installation

To deploy the client library into your local Maven cache from source run:

user@cds:~/git$ git clone https://github.com/ConsumerDataStandardsAustralia/cds-client-java
user@cds:~/git$ cd cds-client-java
user@cds:~/git/cds-client-java$ mvn clean install

To integrate into your Maven project add this dependency to your project’s POM:

<dependency>
  <groupId>au.org.consumerdatastandards</groupId>
  <artifactId>cds-client-java</artifactId>
  <version>0.9.3-SNAPSHOT</version>
  <scope>compile</scope>
</dependency>

To integrate into your Gradle project, add this dependency to your project’s build file:

 repositories {
     mavenCentral()
 }

compile "au.org.consumerdatastandards:cds-client-java:0.9.3-SNAPSHOT"

Code Example

Please follow the installation instructions then, within your Java project create your code as follows:

import java.util.UUID;
import au.org.consumerdatastandards.client.ApiClient;
import au.org.consumerdatastandards.client.ApiException;
import au.org.consumerdatastandards.client.api.BankingProductsAPI;
import au.org.consumerdatastandards.client.model.ResponseBankingProductById;
import au.org.consumerdatastandards.client.model.ResponseBankingProductList;

public class ClientApiProductTest {
    public static void main(String[] args) {
        BankingProductsAPI api = new BankingProductsAPI();

        ApiClient client = new ApiClient();
        client.setBasePath("http://localhost:8080/cds-au/v1");
        client.addDefaultHeader("x-v", "1");
        client.addDefaultHeader("x-min-v", "1");
        client.addDefaultHeader("x-fapi-financial-id", "cds");
        client.addDefaultHeader("x-fapi-customer-last-logged-time", "");
        client.addDefaultHeader("x-fapi-customer-ip-address", "192.168.1.2");
        client.addDefaultHeader("x-fapi-interaction-id", UUID.randomUUID().toString());

        api.setApiClient(client);

        try {
            ResponseBankingProductList result = api.listProducts(null, null, null, null, null, null);

            result.getData().getProducts().forEach(oneProduct -> {
                try {
                    ResponseBankingProductById productDetail = api.getProductDetail(oneProduct.getProductId());
                    System.out.println(productDetail);
            } catch (ApiException e) {
                System.err.println(String.format("Exception when calling BankingProductsAPI#getProductDetail({})", oneProduct.getProductId()));
                e.printStackTrace();
            }

            });
        } catch (ApiException e) {
            System.err.println("Exception when calling BankingProductsAPI#listProducts");
            e.printStackTrace();
        }
   }
}

Model Holder

Requirements

If you wish to simply run the Model Holder you only require Docker.

If you wish to build the CDS Model Holder from source, this requires:

  1. Java 1.8+

  2. Maven/Gradle

Execution

To start the CDS Client CLI execute the Docker command as below (this will load payloads from your local ./custom-payloads directory on boot):

`` docker run -p 8080:8080 -v “./custom-payloads:/opt/payloads” consumerdatastandardsaustralia/cds-holder-java:0.9.3-SNAPSHOT``

user@cds:~$ docker run -p 8080:8080 -v "./custom-payloads:/opt/payloads" consumerdatastandardsaustralia/cds-holder-java:0.9.3-SNAPSHOT

#     ___     ___     ___
#    / __|   |   \   / __|
#   | (__    | |) |  \__ \
#    \___|   |___/   |___/
#  _|"""""|_|"""""|_|"""""|
#  "`-0-0-'"`-0-0-'"`-0-0-'

2019-05-12 00:20:19.228  INFO 1 --- [           main] a.o.c.holder.HolderApplication           : Starting HolderApplication v0.0.2-SNAPSHOT on 3b710824dcdc with PID 1 (/opt/cds-holder/holder.jar started by root in /)
2019-05-12 00:20:19.231  INFO 1 --- [           main] a.o.c.holder.HolderApplication           : No active profile set, falling back to default profiles: default
2019-05-12 00:20:20.143  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-05-12 00:20:20.233  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 80ms. Found 2 repository interfaces.
2019-05-12 00:20:20.519  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$a2a7da07] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-05-12 00:20:20.840  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-05-12 00:20:20.878  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-05-12 00:20:20.878  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.17]
2019-05-12 00:20:20.960  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-05-12 00:20:20.960  INFO 1 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1695 ms
2019-05-12 00:20:21.188  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-05-12 00:20:21.356  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2019-05-12 00:20:21.416  INFO 1 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
2019-05-12 00:20:21.500  INFO 1 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.9.Final}
2019-05-12 00:20:21.502  INFO 1 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2019-05-12 00:20:21.677  INFO 1 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2019-05-12 00:20:21.930  INFO 1 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2019-05-12 00:20:22.782  INFO 1 --- [           main] o.h.t.schema.internal.SchemaCreatorImpl  : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@50b8ae8d'
2019-05-12 00:20:22.785  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-05-12 00:20:23.409  WARN 1 --- [           main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2019-05-12 00:20:23.521  INFO 1 --- [           main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/swagger.json] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
2019-05-12 00:20:23.653  INFO 1 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-05-12 00:20:23.871  INFO 1 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2019-05-12 00:20:23.891  INFO 1 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2019-05-12 00:20:23.912  INFO 1 --- [           main] s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
2019-05-12 00:20:24.091  INFO 1 --- [           main] a.o.c.holder.util.CdsDataLoader          : Reading /payloads/products/xyzbank-deposit-account.json
2019-05-12 00:20:24.271  INFO 1 --- [           main] a.o.c.holder.util.CdsDataLoader          : Saved the following to database:
{
    "productId": "51645",
    "effectiveFrom": "2018-01-12T15:43:00.121Z",
    "effectiveTo": "2020-04-12T15:43:00.121Z",
    <!--- snip ---!>
}
2019-05-12 00:20:24.338  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2019-05-12 00:20:24.340  INFO 1 --- [           main] a.o.c.holder.HolderApplication           : Started HolderApplication in 5.481 seconds (JVM running for 6.024)

Manual Build & Run

The cds-holder-java-spring project is a modularised Maven build. This includes cds-holder-java-spring-server and cds-holder-java-spring-models.

As cds-holder-java-spring-models is used by other artefacts it is recommended to compile and install the modules then execute the spring-boot server.

user@cds:~/git$ git clone https://github.com/ConsumerDataStandardsAustralia/cds-holder-java-spring
user@cds:~/git$ cd cds-holder-java-spring
user@cds:~/git/cds-holder-java-spring$ mvn clean install
user@cds:~/git/cds-holder-java-spring/modules/cds-holder-java-spring-server$ mvn clean spring-boot:run

Server Stubs

Requirements

The Stubs provide a starting point for anyone wishing to develop a Data Holder.

The Stubs are based on the following stack:

  1. Java 1.8+

  2. Maven

  3. Spring Boot >= 2.1.4-RELEASE

  4. Springfox Swagger Integration >= 2.9.2

Starting a Project

As outlined the Stubs are a starting point for a project only. They intentionally do not attempt to provide responses other than null padded objects.

Because the Stubs are intended to be a starter project we recommend cloning then deleting the .git directory before proceeding with your own modifications.

user@cds:~/git$ git clone https://github.com/ConsumerDataStandardsAustralia/cds-stubs-java
user@cds:~/git$ cd cds-stubs-java
user@cds:~/git/cds-stubs-java$ rm -fr .git
user@cds:~/git/cds-stubs-java$ mvn clean spring-boot:run
 [INFO] Scanning for projects...
 [INFO]
 [INFO] ------------< au.org.consumerdatastandards:cds-stubs-java >-------------
 [INFO] Building cds-stubs-java 0.9.3-SNAPSHOT
 [INFO] --------------------------------[ jar ]---------------------------------
 [INFO]
 [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ cds-stubs-java ---
 [INFO] Deleting /tmp/testit/target
 [INFO]
 [INFO] >>> spring-boot-maven-plugin:2.1.4.RELEASE:run (default-cli) > test-compile @ cds-stubs-java >>>
 [INFO]
 [INFO] --- build-helper-maven-plugin:3.0.0:add-source (default) @ cds-stubs-java ---
 [INFO] Source directory: /tmp/testit/src/gen/java added.
 [INFO] Source directory: /tmp/testit/src/main/java added.
 [INFO]
 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ cds-stubs-java ---
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] Copying 0 resource
 [INFO] Copying 1 resource
 [INFO]
 [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ cds-stubs-java ---
 [INFO] Changes detected - recompiling the module!
 [INFO] Compiling 44 source files to /tmp/testit/target/classes
 [INFO]
 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ cds-stubs-java ---
 [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [INFO] skip non existing resourceDirectory /tmp/testit/src/test/resources
 [INFO]
 [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ cds-stubs-java ---
 [INFO] No sources to compile
 [INFO]
 [INFO] <<< spring-boot-maven-plugin:2.1.4.RELEASE:run (default-cli) < test-compile @ cds-stubs-java <<<
 [INFO]
 [INFO]
 [INFO] --- spring-boot-maven-plugin:2.1.4.RELEASE:run (default-cli) @ cds-stubs-java ---

 #     ___     ___     ___
 #    / __|   |   \   / __|
 #   | (__    | |) |  \__ \
 #    \___|   |___/   |___/
 #  _|"""""|_|"""""|_|"""""|
 #  "`-0-0-'"`-0-0-'"`-0-0-'

 2019-05-12 11:24:01.861  INFO 14910 --- [           main] a.o.c.stubs.HolderApplication            : Starting HolderApplication on cds with PID 14910 (~/git/cds-stubs-java started by stuart in ~/git/cds-stubs-java)
 2019-05-12 11:24:01.865  INFO 14910 --- [           main] a.o.c.stubs.HolderApplication            : No active profile set, falling back to default profiles: default
 2019-05-12 11:24:02.733  INFO 14910 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
 2019-05-12 11:24:02.760  INFO 14910 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 21ms. Found 0 repository interfaces.
 2019-05-12 11:24:03.041  INFO 14910 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$9a622311] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
 2019-05-12 11:24:03.386  INFO 14910 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
 2019-05-12 11:24:03.411  INFO 14910 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
 2019-05-12 11:24:03.411  INFO 14910 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.17]
 2019-05-12 11:24:03.493  INFO 14910 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
 2019-05-12 11:24:03.493  INFO 14910 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1583 ms
 2019-05-12 11:24:03.626  INFO 14910 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
 2019-05-12 11:24:03.763  INFO 14910 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
 2019-05-12 11:24:03.816  INFO 14910 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
     name: default
     ...]
 2019-05-12 11:24:03.863  INFO 14910 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.9.Final}
 2019-05-12 11:24:03.864  INFO 14910 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
 2019-05-12 11:24:03.973  INFO 14910 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
 2019-05-12 11:24:04.081  INFO 14910 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
 2019-05-12 11:24:04.253  INFO 14910 --- [           main] o.h.t.schema.internal.SchemaCreatorImpl  : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@329227ed'
 2019-05-12 11:24:04.256  INFO 14910 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
 2019-05-12 11:24:04.480  WARN 14910 --- [           main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
 2019-05-12 11:24:04.587  INFO 14910 --- [           main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
 2019-05-12 11:24:04.716  INFO 14910 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
 2019-05-12 11:24:04.885  INFO 14910 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
 2019-05-12 11:24:04.905  INFO 14910 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
 2019-05-12 11:24:04.932  INFO 14910 --- [           main] s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
 2019-05-12 11:24:05.216  INFO 14910 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
 2019-05-12 11:24:05.220  INFO 14910 --- [           main] a.o.c.stubs.HolderApplication            : Started HolderApplication in 3.62 seconds (JVM running for 6.906)

Conformance Suite

Requirements

If you wish to simply run Conformance you only require Docker.

If you wish to build CDS Conformance this requires:

  1. Java 1.8+

  2. Maven

Execution

To start the CDS Conformance execute the Docker command as below:

docker run -p 8000:8000 consumerdatastandardsaustralia/cds-conformance:0.9.3-SNAPSHOT -b=http://localhost:8080/cds-au/v1 -s

This will complete a Conformance Suite test then execute a python SimpleServer install available at http://localhost:8000.

Alternatively you can write out a HTML report output by ommitting the -s command line argument as follows

docker run -v `pwd`/conformance-result:/opt/cds-conformance/target consumerdatastandardsaustralia/cds-conformance:0.9.3-SNAPSHOT -b=http://localhost:8080/cds-au/v1

This will output a HTML report at: conformance-result/site/serenity/index.html

Manual Build & Run

To manually build and run the Conformance suite, run:

user@cds:~/git$ git clone https://github.com/ConsumerDataStandardsAustralia/cds-conformance
user@cds:~/git$ cd cds-conformance
user@cds:~/git/cds-conformance$ mvn clean verify -DapiBase=http://localhost:8080/cds-au/v1

This will output a Serenity test report in: target/site/serenity/

To compile and install without testing (for inclusion in cds-client-cli):

user@cds:~/git$ git clone https://github.com/ConsumerDataStandardsAustralia/cds-conformance
user@cds:~/git$ cd cds-conformance
user@cds:~/git/cds-conformance$ mvn clean install -DskipTests=true

Product Summariser

Requirements

The Product Summariser is best run from it’s Docker container as it uses a number of pipeline techniques to perform data conversation after initial API consumption.

Native Execution

To start the CDS Client CLI execute the Docker command as below: docker run -v `pwd`/reporting-outputs:/opt/sphinx consumerdatastandardsaustralia/cds-product-summariser:0.9.3-SNAPSHOT -b=http://localhost:8080/cds-au/v1

 user@host:~/$ docker run -v `pwd`/reporting-outputs:/opt/sphinx consumerdatastandardsaustralia/cds-product-summariser:0.9.3-SNAPSHOT -b=http://localhost:8080/cds-au/v1
 Finished: An initial directory structure has been created.

 You should now populate your master file /opt/sphinx/source/index.rst and create other documentation
 source files. Use the Makefile to build the docs, like so:
    make builder
 where "builder" is one of the supported builders, e.g. html, latex or linkcheck.

 2019-07-01 08:51:30.495  INFO   --- [           main] a.o.c.reporting.product.summary.ApiUtil  : Server URL is set to http://localhost:8080/cds-au/v1
 2019-07-01 08:51:30.518  INFO   --- [           main] a.o.c.reporting.product.summary.ApiUtil  : Server URL is set to http://localhost:8080/cds-au/v1
 2019-07-01 08:51:31.167  INFO   --- [           main] a.o.c.r.p.summary.ProductSummariser      : Collecting detailed product information for ad22b1f0967349e8a5d586afe7f0d845
 2019-07-01 08:51:31.313  INFO   --- [           main] a.o.c.r.p.summary.ProductSummariser      : Collecting detailed product information for 7aff9e0e85e6450eb052d4ff2e953223
 2019-07-01 08:51:31.393  INFO   --- [           main] a.o.c.r.p.summary.ProductSummariser      : Collecting detailed product information for 72f214498c7f47a98fe59b794e7c01ab
 2019-07-01 08:51:31.470  INFO   --- [           main] a.o.c.r.p.summary.ProductSummariser      : Collecting detailed product information for 7375f63775b4489a890655e25395e12d
<snip>
 (./cdsproductreport.ind) [12] (./cdsproductreport.aux) )
 (see the transcript file for additional information){/usr/share/texlive/texmf-d
 ist/fonts/enc/dvips/base/8r.enc}</usr/share/texlive/texmf-dist/fonts/type1/urw/
 helvetic/uhvb8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhv
 r8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb></usr/s
 hare/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb>
 Output written on cdsproductreport.pdf (16 pages, 82433 bytes).
 Transcript written on cdsproductreport.log.
 Latexmk: Index file 'cdsproductreport.idx' was written
 Latexmk: Log file says output to 'cdsproductreport.pdf'
 Latexmk: All targets (cdsproductreport.pdf) are up-to-date
 make[1]: Leaving directory '/opt/sphinx/build/latex'

The report will then be available in reporting-outputs/build/html/index.html and the PDF version will be in reporting-outputs/build/latex/cdsproductreport.pdf.

Execution In Sandbox

To access the Desktop Sandbox network additional parameters are required: docker run --network desktop-sandbox_cdsdevnet -v `pwd`/reporting-outputs:/opt/sphinx consumerdatastandardsaustralia/cds-product-summariser:0.9.3-SNAPSHOT -b=http://holder1:8081/cds-au/v1 --consul.enabled=true --consulmaster=10.252.252.2

 user@host:~/$ docker run --network desktop-sandbox_cdsdevnet -v `pwd`/reporting-outputs:/opt/sphinx consumerdatastandardsaustralia/cds-product-summariser:0.9.3-SNAPSHOT -b=http://holder1:8081/cds-au/v1 --consul.enabled=true --consulmaster=10.252.252.2
 ==> Starting Consul agent...
 ==> Joining cluster...
<snip>
 (./cdsproductreport.ind) [12] (./cdsproductreport.aux) )
 (see the transcript file for additional information){/usr/share/texlive/texmf-d
 ist/fonts/enc/dvips/base/8r.enc}</usr/share/texlive/texmf-dist/fonts/type1/urw/
 helvetic/uhvb8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhv
 r8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb></usr/s
 hare/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb>
 Output written on cdsproductreport.pdf (16 pages, 82433 bytes).
 Transcript written on cdsproductreport.log.
 Latexmk: Index file 'cdsproductreport.idx' was written
 Latexmk: Log file says output to 'cdsproductreport.pdf'
 Latexmk: All targets (cdsproductreport.pdf) are up-to-date
 make[1]: Leaving directory '/opt/sphinx/build/latex'

The report will then be available in reporting-outputs/build/html/index.html and the PDF version will be in reporting-outputs/build/latex/cdsproductreport.pdf.

Code Generator

Requirements

If you wish to simply run the CDS Code Generator you only require Docker.

If you wish to build CDS Codegen this requires:

  1. Java 1.8+

  2. Maven

Execution with Docker

To start the CDS Codegen execute the Docker command as below:

user@cds:~$ docker run -it consumerdatastandardsaustralia/cds-codegen-core:0.9.3-SNAPSHOT -h
Usage: <main class> [options]
  Options:
    --generator, -g
      Class name of cds-codegen generator
      Default: au.org.consumerdatastandards.codegen.generator.openapi.SwaggerGenerator
    --included, -i
      Include Section (comma separated)
    --excluded, -e
      Exclude Section (comma separated)
    --help, -?, -h

    --output-file, -o
      Output file to place generated swagger

Manual Build & Run

To manually build and run the CDS Code Generator using Maven, run:

user@cds:~/git$ git clone https://github.com/ConsumerDataStandardsAustralia/cds-codegen
user@cds:~/git$ cd cds-codegen
user@cds:~/git/cds-codegen$ mvn clean install
user@cds:~/git$ cd modules/cds-codegen-core
user@cds:~/git/cds-codegen/modules/cds-codegen-core$ mvn clean package

Once this is completed you can use cds-codegen to produce a number of output types.

Swagger Generation

To generate a swagger file based on cds-models for Banking product APIs you can use the SwaggerGenerator implementation as follows: java -jar target/cds-codegen-core-0.9.3-SNAPSHOT.jar -i "BankingProducts" -o /tmp/swagger.json

user@cds:~/git/cds-codegen/modules/cds-codegen-core$ java -jar target/cds-codegen-core-0.9.3-SNAPSHOT.jar -i "BankingProducts" -o /tmp/swagger.json
 2019-07-01 18:21:32.380  INFO   --- [           main] org.reflections.Reflections              : Reflections took 75 ms to scan 1 urls, producing 6 keys and 187 values
 2019-07-01 18:21:32.727  INFO   --- [           main] a.o.c.c.g.openapi.SwaggerGenerator       : Successfully wrote swagger to /tmp/swagger.json

To generate a Java Client Library output you can use the CodeGenerator implementation as follows: java -jar target/cds-codegen-core-0.9.3-SNAPSHOT.jar -i "BankingProducts" -g au.org.consumerdatastandards.codegen.generator.code.CodeGenerator -t cds-client-java -o /tmp/outputgen

user@cds:~/git/cds-codegen/modules/cds-codegen-core$ java -jar target/cds-codegen-core-0.9.3-SNAPSHOT.jar -i "BankingProducts" -g au.org.consumerdatastandards.codegen.generator.code.CodeGenerator -t cds-client-java -o /tmp/outputgen
2019-07-01 18:22:58.296  INFO   --- [           main] org.reflections.Reflections              : Reflections took 84 ms to scan 1 urls, producing 6 keys and 187 values
2019-07-01 18:22:58.564  INFO   --- [           main] org.reflections.Reflections              : Reflections took 49 ms to scan 1 urls, producing 20 keys and 304 values
2019-07-01 18:22:58.668  INFO   --- [           main] org.reflections.Reflections              : Reflections took 22 ms to scan 1 urls, producing 20 keys and 304 values
2019-07-01 18:22:59.525  INFO   --- [           main] org.reflections.Reflections              : Reflections took 32 ms to scan 1 urls, producing 20 keys and 304 values
2019-07-01 18:22:59.545  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/ApiCallback.java
2019-07-01 18:22:59.672  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/ApiClient.java
2019-07-01 18:22:59.682  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/ApiException.java
2019-07-01 18:22:59.692  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/ApiResponse.java
2019-07-01 18:22:59.696  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/Configuration.java
2019-07-01 18:22:59.705  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/GzipRequestInterceptor.java
2019-07-01 18:22:59.729  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/JSON.java
2019-07-01 18:22:59.736  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/Pair.java
2019-07-01 18:22:59.743  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/ProgressRequestBody.java
2019-07-01 18:22:59.749  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/ProgressResponseBody.java
2019-07-01 18:22:59.756  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/StringUtil.java
2019-07-01 18:22:59.759  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/pom.xml
2019-07-01 18:22:59.772  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/ResponseBankingProductList.java
2019-07-01 18:22:59.788  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/PaginatedResponse.java
2019-07-01 18:22:59.806  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/LinksPaginated.java
2019-07-01 18:22:59.818  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/MetaPaginated.java
2019-07-01 18:22:59.829  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/ResponseBankingProductListData.java
2019-07-01 18:22:59.864  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProduct.java
2019-07-01 18:22:59.881  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingEnumProductCategory.java
2019-07-01 18:22:59.907  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductAdditionalInformation.java
2019-07-01 18:22:59.919  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/ParamEffective.java
2019-07-01 18:22:59.935  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/ParamProductCategory.java
2019-07-01 18:22:59.950  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/ResponseBankingProductById.java
2019-07-01 18:22:59.966  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BaseResponse.java
2019-07-01 18:22:59.977  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/Links.java
2019-07-01 18:22:59.986  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/Meta.java
2019-07-01 18:23:00.046  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductDetail.java
2019-07-01 18:23:00.061  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductBundle.java
2019-07-01 18:23:00.076  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductFeature.java
2019-07-01 18:23:00.092  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductConstraint.java
2019-07-01 18:23:00.107  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductEligibility.java
2019-07-01 18:23:00.134  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductFee.java
2019-07-01 18:23:00.170  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductDiscount.java
2019-07-01 18:23:00.190  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductDiscountEligibility.java
2019-07-01 18:23:00.217  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductDepositRate.java
2019-07-01 18:23:00.244  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductRateTier.java
2019-07-01 18:23:00.255  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductRateCondition.java
2019-07-01 18:23:00.278  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductRateTierSubTier.java
2019-07-01 18:23:00.302  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/model/BankingProductLendingRate.java
2019-07-01 18:23:00.362  INFO   --- [           main] a.o.c.c.generator.code.VelocityHelper    : Wrote file: /tmp/outputgen/src/main/java/au/org/consumerdatastandards/client/api/BankingProductsAPI.java
2019-07-01 18:23:00.363  INFO   --- [           main] a.o.c.c.generator.code.CodeGenerator     : Code Generator output complete

Comments

comments powered by Disqus