Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Commit ff5aaf7

Browse files
committed
Upgrade to Platform 1.07
1 parent 4cc4af7 commit ff5aaf7

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<parent>
1313
<groupId>com.proofpoint.platform</groupId>
1414
<artifactId>rest-server-base</artifactId>
15-
<version>1.05</version>
15+
<version>1.07</version>
1616
</parent>
1717

1818
<licenses>

src/test/java/com/proofpoint/event/collector/TestServer.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import static com.proofpoint.http.client.Request.Builder.prepareDelete;
5757
import static com.proofpoint.http.client.Request.Builder.prepareGet;
5858
import static com.proofpoint.http.client.Request.Builder.preparePost;
59+
import static com.proofpoint.http.client.SmileBodyGenerator.smileBodyGenerator;
5960
import static com.proofpoint.http.client.StaticBodyGenerator.createStaticBodyGenerator;
6061
import static com.proofpoint.http.client.StatusResponseHandler.createStatusResponseHandler;
6162
import static com.proofpoint.http.client.StringResponseHandler.createStringResponseHandler;
@@ -169,18 +170,10 @@ public void testPostSmile()
169170
throws IOException, ExecutionException, InterruptedException
170171
{
171172
StatusResponse response = client.execute(preparePost()
172-
.setUri(urlFor("/v2/event"))
173-
.setHeader("Content-Type", "application/x-jackson-smile")
174-
.setBodyGenerator(new BodyGenerator()
175-
{
176-
@Override
177-
public void write(OutputStream outputStream)
178-
throws Exception
179-
{
180-
MAPPER.writeValue(outputStream, TESTING_SINGLE_EVENT_STRUCTURE);
181-
}
182-
})
183-
.build(),
173+
.setUri(urlFor("/v2/event"))
174+
.setHeader("Content-Type", "application/x-jackson-smile")
175+
.setBodyGenerator(smileBodyGenerator(OBJECT_CODEC, TESTING_SINGLE_EVENT_STRUCTURE))
176+
.build(),
184177
createStatusResponseHandler());
185178

186179
assertEquals(response.getStatusCode(), Status.ACCEPTED.getStatusCode());
@@ -248,15 +241,7 @@ public void testDistributeSmile()
248241
StatusResponse response = client.execute(preparePost()
249242
.setUri(urlFor("/v2/event/distribute"))
250243
.setHeader("Content-Type", "application/x-jackson-smile")
251-
.setBodyGenerator(new BodyGenerator()
252-
{
253-
@Override
254-
public void write(OutputStream outputStream)
255-
throws Exception
256-
{
257-
MAPPER.writeValue(outputStream, TESTING_SINGLE_EVENT_STRUCTURE);
258-
}
259-
})
244+
.setBodyGenerator(smileBodyGenerator(OBJECT_CODEC, TESTING_SINGLE_EVENT_STRUCTURE))
260245
.build(),
261246
createStatusResponseHandler());
262247

0 commit comments

Comments
 (0)