Skip to content

Commit

Permalink
XIVY-12055 Moved Mock-API to demo-project and updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-edp committed Aug 25, 2023
1 parent c06f2af commit 932b8f7
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 46 deletions.
4 changes: 2 additions & 2 deletions srf-weather-connector-WebTest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<dependency>
<groupId>com.axonivy.connector.srf.weather</groupId>
<artifactId>srf-weather-connector-demo</artifactId>
<version>10.0.0-SNAPSHOT</version>
<version>10.0.2-SNAPSHOT</version>
<type>iar</type>
</dependency>
<dependency>
<groupId>com.axonivy.connector.srf.weather</groupId>
<artifactId>srf-weather-connector-test</artifactId>
<version>10.0.0-SNAPSHOT</version>
<version>10.0.2-SNAPSHOT</version>
<type>iar</type>
</dependency>
<dependency>
Expand Down
3 changes: 3 additions & 0 deletions srf-weather-connector-demo/config/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Variables:
# All variables related to the SRF Weather connector
SrfWeatherConnector:
# For testing you can use the following Variable to refer to the testing Mock API under: 'http://localhost:8081/designer/api/weatherMock'
# Url: http://localhost:8081/designer/api/weatherMock

# Your Access Token for SRF weather connector
# This token serves as your authentication key for accessing the SRF API.
# [password]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
@Path(WeatherMock.PATH_SUFFIX)
@PermitAll
public class WeatherMock {

static final String PATH_SUFFIX = "weatherMock";
// URI where this mock can be reached: to be referenced in tests that use it!
public static final String URI = "{ivy.app.baseurl}/api/" + PATH_SUFFIX;
Expand Down
5 changes: 4 additions & 1 deletion srf-weather-connector-product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ The connector:
* supports you with an easy-to-copy demo implementation to reduce your
integration effort.
* enables low code citizen developers to enhance existing business processes
with currency converter features.
with weather forecast features.

## Demo

Install the SRF Weather Connector and call it as a sub-process. Adjust the mapping accordingly.
![set connector as subprocess](images/demo1.png)

For testing purposes, a mock API can be used in the demo instead of the official SRF API. For this purpose, the variable "Url" can be commented out under 'Variables.SrfWeatherConnector'.
This way you can avoid the need to generate an access token via the SRF Developer website first. In this mock mode, only the ZIP code "6300" must be entered in the "zip" field.

In the demo, you can now specify either the name of the location or its ZIP code and use the "Get Weather" button to output the weather for the next seven days at this location.
![enter data name or zip](images/demo2.png)

Expand Down
90 changes: 48 additions & 42 deletions srf-weather-connector-test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,44 +1,50 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.axonivy.connector.srf.weather</groupId>
<artifactId>srf-weather-connector-test</artifactId>
<version>10.0.2-SNAPSHOT</version>
<packaging>iar</packaging>
<dependencies>
<dependency>
<groupId>com.axonivy.ivy.test</groupId>
<artifactId>unit-tester</artifactId>
<version>10.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.axonivy.connector.srf.weather</groupId>
<artifactId>srf-weather-connector</artifactId>
<version>${project.version}</version>
<type>iar</type>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src_test</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.6</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.axonivy.connector.srf.weather</groupId>
<artifactId>srf-weather-connector-test</artifactId>
<version>10.0.2-SNAPSHOT</version>
<packaging>iar</packaging>
<dependencies>
<dependency>
<groupId>com.axonivy.ivy.test</groupId>
<artifactId>unit-tester</artifactId>
<version>10.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.axonivy.connector.srf.weather</groupId>
<artifactId>srf-weather-connector</artifactId>
<version>${project.version}</version>
<type>iar</type>
</dependency>
<dependency>
<groupId>com.axonivy.connector.srf.weather</groupId>
<artifactId>srf-weather-connector-demo</artifactId>
<version>10.0.2-SNAPSHOT</version>
<type>iar</type>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src_test</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.6</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 932b8f7

Please sign in to comment.