From ff5aaf7cbcc64b54c0eae71acfb2bcbd30b5fc47 Mon Sep 17 00:00:00 2001 From: John Myers Date: Wed, 12 Nov 2014 11:27:26 -0800 Subject: [PATCH] Upgrade to Platform 1.07 --- pom.xml | 2 +- .../event/collector/TestServer.java | 27 +++++-------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index d6e28b2..d662d31 100755 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ com.proofpoint.platform rest-server-base - 1.05 + 1.07 diff --git a/src/test/java/com/proofpoint/event/collector/TestServer.java b/src/test/java/com/proofpoint/event/collector/TestServer.java index a7b0b8a..86d3b0e 100755 --- a/src/test/java/com/proofpoint/event/collector/TestServer.java +++ b/src/test/java/com/proofpoint/event/collector/TestServer.java @@ -56,6 +56,7 @@ import static com.proofpoint.http.client.Request.Builder.prepareDelete; import static com.proofpoint.http.client.Request.Builder.prepareGet; import static com.proofpoint.http.client.Request.Builder.preparePost; +import static com.proofpoint.http.client.SmileBodyGenerator.smileBodyGenerator; import static com.proofpoint.http.client.StaticBodyGenerator.createStaticBodyGenerator; import static com.proofpoint.http.client.StatusResponseHandler.createStatusResponseHandler; import static com.proofpoint.http.client.StringResponseHandler.createStringResponseHandler; @@ -169,18 +170,10 @@ public void testPostSmile() throws IOException, ExecutionException, InterruptedException { StatusResponse response = client.execute(preparePost() - .setUri(urlFor("/v2/event")) - .setHeader("Content-Type", "application/x-jackson-smile") - .setBodyGenerator(new BodyGenerator() - { - @Override - public void write(OutputStream outputStream) - throws Exception - { - MAPPER.writeValue(outputStream, TESTING_SINGLE_EVENT_STRUCTURE); - } - }) - .build(), + .setUri(urlFor("/v2/event")) + .setHeader("Content-Type", "application/x-jackson-smile") + .setBodyGenerator(smileBodyGenerator(OBJECT_CODEC, TESTING_SINGLE_EVENT_STRUCTURE)) + .build(), createStatusResponseHandler()); assertEquals(response.getStatusCode(), Status.ACCEPTED.getStatusCode()); @@ -248,15 +241,7 @@ public void testDistributeSmile() StatusResponse response = client.execute(preparePost() .setUri(urlFor("/v2/event/distribute")) .setHeader("Content-Type", "application/x-jackson-smile") - .setBodyGenerator(new BodyGenerator() - { - @Override - public void write(OutputStream outputStream) - throws Exception - { - MAPPER.writeValue(outputStream, TESTING_SINGLE_EVENT_STRUCTURE); - } - }) + .setBodyGenerator(smileBodyGenerator(OBJECT_CODEC, TESTING_SINGLE_EVENT_STRUCTURE)) .build(), createStatusResponseHandler());