Skip to content

Commit

Permalink
Update wiremock tests
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Oct 15, 2024
1 parent cecb9f4 commit 071c324
Show file tree
Hide file tree
Showing 77 changed files with 997 additions and 136 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
call-workflow:
strategy:
matrix:
josm-revision: ["", "r18877"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v2
josm-revision: ["", "r19067"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v3
with:
java-version: 17
josm-revision: ${{ matrix.josm-revision }}
plugin-jar-name: 'mapwithai'
perform-revision-tagging: ${{ matrix.josm-revision == 'r18877' && github.repository == 'JOSM/MapWithAI' && github.ref_type == 'branch' && github.ref_name == 'master' && github.event_name != 'schedule' && github.event_name != 'pull_request' }}
perform-revision-tagging: ${{ matrix.josm-revision == 'r19067' && github.repository == 'JOSM/MapWithAI' && github.ref_type == 'branch' && github.ref_name == 'master' && github.event_name != 'schedule' && github.event_name != 'pull_request' }}
secrets: inherit

2 changes: 1 addition & 1 deletion .github/workflows/reports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ permissions:

jobs:
call-workflow:
uses: JOSM/JOSMPluginAction/.github/workflows/reports.yaml@v2
uses: JOSM/JOSMPluginAction/.github/workflows/reports.yaml@v3
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# The minimum JOSM version this plugin is compatible with (can be any numeric version
plugin.main.version = 18877
plugin.main.version = 19067
# The JOSM version this plugin is currently compiled against
# Please make sure this version is available at https://josm.openstreetmap.de/download
# The special values "latest" and "tested" are also possible here, but not recommended.
plugin.compile.version = 18877
plugin.compile.version = 19067
plugin.canloadatruntime = true
plugin.author = Taylor Smock
plugin.class = org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin
Expand Down
193 changes: 193 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openstreetmap.josm.plugins</groupId>
<artifactId>MapWithAI</artifactId>
<version>SNAPSHOT</version>
<properties>
<jmockit.version>1.49.a</jmockit.version>
<pmd.version>7.5.0</pmd.version>
<jacoco.version>0.8.12</jacoco.version>
<checkstyle.version>10.18.1</checkstyle.version>
<spotbugs.version>4.8.6</spotbugs.version>
</properties>
<repositories>
<repository>
<id>JOSM-releases</id>
<url>https://josm.openstreetmap.de/nexus/content/repositories/releases/</url>
</repository>
<repository>
<id>JOSM-snapshots</id>
<url>https://josm.openstreetmap.de/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.openstreetmap.josm</groupId>
<artifactId>josm</artifactId>
<version>SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openstreetmap.josm.plugins</groupId>
<artifactId>pmtiles</artifactId>
<version>SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openstreetmap.josm.plugins</groupId>
<artifactId>utilsplugin2</artifactId>
<version>SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openstreetmap.josm</groupId>
<artifactId>josm-unittest</artifactId>
<version>SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency> <!-- needed until JOSM core removes Junit4 support -->
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.17</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>1.49.a</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>2.1.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/test/unit</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<configuration>
<java>
<eclipse>
<version>4.21</version>
<file>${project.basedir}/../00_core_tools/eclipse/formatter.xml</file>
</eclipse>
<removeUnusedImports/>
<licenseHeader>
<content>// License: GPL. For details, see LICENSE file.</content>
</licenseHeader>
<includes>
<include>src/main/java/**/*.java</include>
<include>src/test/unit/**/*.java</include>
<include>src/test/integration/**/*.java</include>
</includes>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
</rules>
</configuration>
</plugin>
<!-- Configure the test plugin, specifically enable autodetection of global extensions -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<skipAfterFailureCount>1</skipAfterFailureCount>
<argLine>-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar</argLine>
<properties>
<configurationParameters>
file.encoding = UTF-8
java.locale.providers = SPI,CLDR
junit.jupiter.extensions.autodetection.enabled = true
junit.jupiter.execution.parallel.enabled = true
</configurationParameters>
</properties>
<systemPropertyVariables>
<josm.home>src/test/build/config/josm.home</josm.home>
<josm.test.data>src/test/resources</josm.test.data>
<java.awt.headless>true</java.awt.headless>
<glass.platform>Monocle</glass.platform>
<monocle.platform>Headless</monocle.platform>
<prism.order>sw</prism.order>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@ private void updateEsriLayers(@Nonnull final Collection<MapWithAIInfo> layers) {
Logging.error(e);
}
}
} else {
esriInfo.add(layer);
}
}
layers.addAll(esriInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@
},
"response" : {
"status" : 200,
"body" : "{\n \"Taylor's Address Conflation Server\" : {\n \"categories\" : [\n \"addresses\"\n ],\n \"description\" : \"Originally developed for use with local datasets, it now accepts external datasets for conflation purposes. In the event of a failure, the plugin will use the original dataset.\",\n \"license\" : \"AGPL\",\n \"source\" : \"https://gitlab.com/smocktaylor/serve_osm_files/\",\n \"url\" : \"https://importdata.riverviewtechnologies.com/conflate\"\n }\n}\n",
"jsonBody": {
"Taylor's Address Conflation Server": {
"categories": [
"addresses"
],
"description": "Originally developed for use with local datasets, it now accepts external datasets for conflation purposes. In the event of a failure, the plugin will use the original dataset.",
"license": "AGPL",
"source": "{{ request.baseUrl }}/smocktaylor/serve_osm_files/",
"url": "{{ request.baseUrl }}/conflate"
}
},
"transformers": [
"response-template"
],
"headers" : {
"Accept-Ranges" : "bytes",
"Cache-Control" : "max-age=600",
Expand Down
Loading

0 comments on commit 071c324

Please sign in to comment.