File tree 3 files changed +18
-10
lines changed
main/scala/addresspoints/api
3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -55,3 +55,4 @@ project/plugins/project/
55
55
.scala_dependencies
56
56
.worksheet
57
57
scalastyle-config.xml
58
+ .idea /
Original file line number Diff line number Diff line change @@ -51,22 +51,22 @@ trait Service extends JsonProtocol with Geocode {
51
51
pathPrefix(" addresses" ) {
52
52
53
53
path(" points" ) {
54
- get {
54
+ post {
55
55
compressResponseIfRequested() {
56
- parameter(' search .as[String ]) { address =>
57
- geocodePoint(address)
56
+ entity(as[String ]) { json =>
57
+ val addressInput = json.parseJson.convertTo[AddressInput ]
58
+ geocodePoint(addressInput.address)
58
59
}
59
60
}
60
- } ~
61
- post {
61
+ }
62
+ } ~
63
+ path(" points" / Segment ) { address =>
64
+ get {
62
65
compressResponseIfRequested() {
63
- entity(as[String ]) { json =>
64
- val addressInput = json.parseJson.convertTo[AddressInput ]
65
- geocodePoint(addressInput.address)
66
- }
66
+ geocodePoint(address)
67
67
}
68
68
}
69
- }
69
+ }
70
70
}
71
71
}
72
72
Original file line number Diff line number Diff line change @@ -70,6 +70,13 @@ class AddressPointServiceSpec extends FlatSpec with MustMatchers with ScalatestR
70
70
val f = responseAs[Feature ]
71
71
f mustBe getPointFeature
72
72
}
73
+ val a = " 1311+30th+St+NW+Washington+DC+20007"
74
+ Get (" /addresses/points/" + a) ~> routes ~> check {
75
+ status mustBe OK
76
+ contentType.mediaType mustBe `application/json`
77
+ val f = responseAs[Feature ]
78
+ f mustBe getPointFeature
79
+ }
73
80
}
74
81
75
82
}
You can’t perform that action at this time.
0 commit comments