This repository was archived by the owner on Jan 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
src/test/java/com/proofpoint/event/collector Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 5656import static com .proofpoint .http .client .Request .Builder .prepareDelete ;
5757import static com .proofpoint .http .client .Request .Builder .prepareGet ;
5858import static com .proofpoint .http .client .Request .Builder .preparePost ;
59+ import static com .proofpoint .http .client .SmileBodyGenerator .smileBodyGenerator ;
5960import static com .proofpoint .http .client .StaticBodyGenerator .createStaticBodyGenerator ;
6061import static com .proofpoint .http .client .StatusResponseHandler .createStatusResponseHandler ;
6162import 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 ());
You can’t perform that action at this time.
0 commit comments