Set the location string correctly for intent POST operations
Change-Id: I7ddb98ca1c5e87fc0fe34c79c5499047e599191f
Showing
2 changed files
with
2 additions
and
2 deletions
... | @@ -152,7 +152,7 @@ public class IntentsWebResource extends AbstractWebResource { | ... | @@ -152,7 +152,7 @@ public class IntentsWebResource extends AbstractWebResource { |
152 | service.submit(intent); | 152 | service.submit(intent); |
153 | UriBuilder locationBuilder = uriInfo.getBaseUriBuilder() | 153 | UriBuilder locationBuilder = uriInfo.getBaseUriBuilder() |
154 | .path("intents") | 154 | .path("intents") |
155 | - .path(Short.toString(intent.appId().id())) | 155 | + .path(intent.appId().name()) |
156 | .path(Long.toString(intent.id().fingerprint())); | 156 | .path(Long.toString(intent.id().fingerprint())); |
157 | return Response | 157 | return Response |
158 | .created(locationBuilder.build()) | 158 | .created(locationBuilder.build()) | ... | ... |
... | @@ -400,7 +400,7 @@ public class IntentsResourceTest extends ResourceTest { | ... | @@ -400,7 +400,7 @@ public class IntentsResourceTest extends ResourceTest { |
400 | .post(ClientResponse.class, jsonStream); | 400 | .post(ClientResponse.class, jsonStream); |
401 | assertThat(response.getStatus(), is(HttpURLConnection.HTTP_CREATED)); | 401 | assertThat(response.getStatus(), is(HttpURLConnection.HTTP_CREATED)); |
402 | String location = response.getLocation().getPath(); | 402 | String location = response.getLocation().getPath(); |
403 | - assertThat(location, Matchers.startsWith("/intents/2/")); | 403 | + assertThat(location, Matchers.startsWith("/intents/myApp/")); |
404 | } | 404 | } |
405 | 405 | ||
406 | /** | 406 | /** | ... | ... |
-
Please register or login to post a comment