From d733294cb16fa83be014ce1efccbf364aa309d25 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Fri, 14 Jul 2017 15:05:12 -0700 Subject: Fix PR --- .../xyz/driver/pdsuidomain/services/rest/RestHelper.scala | 13 ++++--------- .../pdsuidomain/services/rest/RestMessageService.scala | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/rest') diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHelper.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHelper.scala index 3113b21..5284ff1 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHelper.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHelper.scala @@ -74,21 +74,16 @@ trait RestHelper { case Some(pp) => Seq( "pageNumber" -> pp.pageNumber.toString, - "pageSize" -> pp.pageSize.toHexString + "pageSize" -> pp.pageSize.toString ) } - /** Utility method to parse responses that encode success and errors as subtypes - * of a common reply type. + /** Utility method to parse responses from records-acquisition-server. * + * Non-2xx HTTP error codes will be cause the returned future to fail with a corresponding + * `DomainException`. * @tparam ApiReply The type of the serialized reply object, contained in the HTTP entity - * @tparam DomainReply The type of the domain object that will be created from a successful reply. - * * @param response The HTTP response to parse. - * @param successMapper Transformation function from a deserialized api entity to a domain object. - * @param errorMapper Transformation function from general domain errors to - * specialized errors of the given DomainReply. Note that if a domain error - * is not explicitly handled, it will be encoded as a failure in the returned future. * @param unmarshaller An unmarshaller that converts a successful response to an api reply. */ def apiResponse[ApiReply](response: HttpResponse)( diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestMessageService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestMessageService.scala index 4eb48d5..1527ad5 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestMessageService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestMessageService.scala @@ -76,7 +76,7 @@ class RestMessageService(transport: ServiceTransport, baseUri: Uri)( } def delete(messageId: LongId[Message])(implicit requestContext: AuthenticatedRequestContext): Future[DeleteReply] = { - val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/message/${messageId.id}")) + val request = HttpRequest(HttpMethods.DELETE, endpointUri(baseUri, s"/v1/message/${messageId.id}")) for { response <- transport.sendRequestGetResponse(requestContext)(request) reply <- apiResponse[ApiMessage](response) -- cgit v1.2.3