-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The README explains how to create mock data.
- Loading branch information
1 parent
8298565
commit 6cf7b97
Showing
13 changed files
with
163 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ target | |
*.log | ||
*.old | ||
tmp/ | ||
wiremock-standalone*.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/test/resources/wiremock/__files/body-reverse.php-HEW8N.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"place_id":197984090,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright","osm_type":"relation","osm_id":34917,"lat":"43.6434","lon":"1.37799","display_name":"Blagnac, Toulouse, Haute-Garonne, Occitanie, France métropolitaine, 31700, France","address":{"city":"Blagnac","county":"Toulouse","state":"Occitanie","country":"France","postcode":"31700","country_code":"fr"},"boundingbox":["43.6153211","43.6665816","1.3473655","1.4068502"]} |
1 change: 1 addition & 0 deletions
1
src/test/resources/wiremock/__files/body-reverse.php-WOqlB.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"place_id":199056147,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright","osm_type":"relation","osm_id":5811926,"lat":"44.5818895","lon":"2.37392262700056","display_name":"Conques-en-Rouergue, Rodez, Aveyron, Occitanie, France métropolitaine, 12320, France","address":{"city":"Conques-en-Rouergue","county":"Rodez","state":"Occitanie","country":"France","postcode":"12320","country_code":"fr"},"boundingbox":["44.4985817","44.665169","2.3152872","2.464032"]} |
1 change: 1 addition & 0 deletions
1
src/test/resources/wiremock/__files/body-reverse.php-dp8tx.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"place_id":218390850,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright","osm_type":"relation","osm_id":124909,"lat":"43.6402778","lon":"0.02","display_name":"Tasque, Mirande, Gers, Occitania, Metropolitan France, 32160, France","address":{"city":"Tasque","county":"Mirande","state":"Occitanie","country":"France","postcode":"32160","country_code":"fr"},"boundingbox":["43.6207693","43.6536688","-0.0167693","0.0406909"]} |
1 change: 1 addition & 0 deletions
1
src/test/resources/wiremock/__files/body-reverse.php-smE8J.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"error":"Unable to geocode"} |
24 changes: 24 additions & 0 deletions
24
src/test/resources/wiremock/mappings/mapping-reverse.php-HEW8N.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"id" : "a819abf5-5d89-3c46-b74f-f71830edaf6d", | ||
"request" : { | ||
"url" : "/reverse.php?format=json&lat=43.636883&lon=1.373484&zoom=10", | ||
"method" : "GET" | ||
}, | ||
"response" : { | ||
"status" : 200, | ||
"bodyFileName" : "body-reverse.php-HEW8N.json", | ||
"headers" : { | ||
"Date" : "Wed, 13 Nov 2019 14:59:42 GMT", | ||
"Server" : "Apache/2.4.29 (Ubuntu)", | ||
"Access-Control-Allow-Origin" : "*", | ||
"Access-Control-Allow-Methods" : "OPTIONS,GET", | ||
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", | ||
"Expect-CT" : "max-age=0, report-uri=\"https://openstreetmap.report-uri.com/r/d/ct/reportOnly\"", | ||
"Upgrade" : "h2", | ||
"Connection" : "Upgrade, close", | ||
"Transfer-Encoding" : "chunked", | ||
"Content-Type" : "application/json; charset=UTF-8" | ||
} | ||
}, | ||
"uuid" : "a819abf5-5d89-3c46-b74f-f71830edaf6d" | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/resources/wiremock/mappings/mapping-reverse.php-WOqlB.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"id" : "18a04d1b-2bda-30b1-8a5b-1640dde422c5", | ||
"request" : { | ||
"url" : "/reverse.php?format=json&lat=44.636883&lon=2.373484&zoom=10", | ||
"method" : "GET" | ||
}, | ||
"response" : { | ||
"status" : 200, | ||
"bodyFileName" : "body-reverse.php-WOqlB.json", | ||
"headers" : { | ||
"Date" : "Wed, 13 Nov 2019 14:59:29 GMT", | ||
"Server" : "Apache/2.4.29 (Ubuntu)", | ||
"Access-Control-Allow-Origin" : "*", | ||
"Access-Control-Allow-Methods" : "OPTIONS,GET", | ||
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", | ||
"Expect-CT" : "max-age=0, report-uri=\"https://openstreetmap.report-uri.com/r/d/ct/reportOnly\"", | ||
"Upgrade" : "h2", | ||
"Connection" : "Upgrade, close", | ||
"Transfer-Encoding" : "chunked", | ||
"Content-Type" : "application/json; charset=UTF-8" | ||
} | ||
}, | ||
"uuid" : "18a04d1b-2bda-30b1-8a5b-1640dde422c5" | ||
} |
21 changes: 21 additions & 0 deletions
21
src/test/resources/wiremock/mappings/mapping-reverse.php-dp8tx.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"id" : "46e00f97-abd9-3e9a-b7c6-24cc0234c4ca", | ||
"request" : { | ||
"url" : "/reverse.php?format=json&lat=43.636883&lon=0.000932&zoom=10", | ||
"method" : "GET" | ||
}, | ||
"response" : { | ||
"status" : 200, | ||
"bodyFileName" : "body-reverse.php-dp8tx.json", | ||
"headers" : { | ||
"Date" : "Thu, 14 Nov 2019 16:07:27 GMT", | ||
"Server" : "Apache/2.4.38 (Ubuntu)", | ||
"Access-Control-Allow-Origin" : "*", | ||
"Access-Control-Allow-Methods" : "OPTIONS,GET", | ||
"Keep-Alive" : "timeout=5, max=100", | ||
"Connection" : "Keep-Alive", | ||
"Content-Type" : "application/json; charset=UTF-8" | ||
} | ||
}, | ||
"uuid" : "46e00f97-abd9-3e9a-b7c6-24cc0234c4ca" | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/resources/wiremock/mappings/mapping-reverse.php-smE8J.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"id" : "ab2b80ed-fe21-3c8a-a440-f985593cb585", | ||
"request" : { | ||
"url" : "/reverse.php?format=json&lat=41.270568&lon=6.670123&zoom=10", | ||
"method" : "GET" | ||
}, | ||
"response" : { | ||
"status" : 200, | ||
"bodyFileName" : "body-reverse.php-smE8J.json", | ||
"headers" : { | ||
"Date" : "Wed, 13 Nov 2019 14:59:04 GMT", | ||
"Server" : "Apache/2.4.29 (Ubuntu)", | ||
"Access-Control-Allow-Origin" : "*", | ||
"Access-Control-Allow-Methods" : "OPTIONS,GET", | ||
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", | ||
"Expect-CT" : "max-age=0, report-uri=\"https://openstreetmap.report-uri.com/r/d/ct/reportOnly\"", | ||
"Upgrade" : "h2", | ||
"Connection" : "Upgrade, close", | ||
"Transfer-Encoding" : "chunked", | ||
"Content-Type" : "application/json; charset=UTF-8" | ||
} | ||
}, | ||
"uuid" : "ab2b80ed-fe21-3c8a-a440-f985593cb585" | ||
} |
27 changes: 27 additions & 0 deletions
27
src/test/scala/io/arlas/data/transform/ArlasMockServer.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.arlas.data.transform | ||
|
||
import com.github.tomakehurst.wiremock.WireMockServer | ||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration.options | ||
import io.arlas.data.app.ArlasProcConfig | ||
import org.scalatest.{BeforeAndAfterEach, Suite} | ||
|
||
trait ArlasMockServer extends BeforeAndAfterEach { | ||
|
||
this: Suite => | ||
|
||
ArlasProcConfig.GEODATA_BASE_PATH = "http://localhost:8080" | ||
|
||
private val wireMockServer = new WireMockServer( | ||
options() | ||
.port(8080) | ||
.usingFilesUnderClasspath("wiremock")) | ||
|
||
override def beforeEach { | ||
wireMockServer.start() | ||
} | ||
|
||
override def afterEach { | ||
wireMockServer.stop() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters