Skip to content

3. Initial data load

Elan Thangamani edited this page Aug 29, 2020 · 11 revisions

How to setup Initial load

  1. The following properties would used to setup the initial data for the virtualized service.
virtualan.data.load=<file name from classpath>
  1. The following information added in the application.properties for the application startup.
server.port=8080
virtualan.datasource.driver-class-name=org.hsqldb.jdbcDriver
virtualan.datasource.jdbcurl=jdbc:hsqldb:mem:dataSource
virtualan.datasource.username=sa
virtualan.datasource.password=
virtualan.application.name=The Service Virtualization Product
virtualan.data.load=initial-load.json
  1. For the above sample initial-load.json is the file name should be a available in the classpath. Example file: https://github.com/virtualansoftware/virtualan/blob/master/samples/virtualan-openapi-rest/src/main/resources/initial-load.json

How to create the initial data to be loaded.

  1. Using this How to populate the data in the system prepare the data and follow below process to download the JSON to be loaded..

  2. Navigate to the following URL to load data using REST API : http://localhost:8080/swagger-ui/index.html?url=/yaml/VirtualService/virtualservices.yaml

  3. Run the http://localhost:8080/virtualservices - Get all Mock service data and download the JSON output and That JSON directly loaded as the initial set of data.

  4. Now Check-in the JSON in the Virtualized code repository and specify the file in the "virtualan.data.load" in the application properties.

  5. Now next build it will load with the these data.

  6. IMPORTANT NOTE: The following fields would be ignored while loading if it was part of the initial load (id, usageCount and lastUsedDateTime)

    "id": 1,
    "usageCount": 0,
    "lastUsedDateTime": "2020-08-29T21:07:16.466+0000"