use of org.jbpm.document.service.impl.DocumentImpl in project jbpm-work-items by kiegroup.
the class TwitterWorkitemHandlerTest method testUpdateStatusWithMedia.
@Test
public void testUpdateStatusWithMedia() throws Exception {
DocumentImpl testMediaDoc = new DocumentImpl();
testMediaDoc.setContent(new String("Test media to send").getBytes());
testMediaDoc.setName("testMediaToSend.txt");
TestWorkItemManager manager = new TestWorkItemManager();
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter("StatusUpdate", "testUpdateStatus");
workItem.setParameter("Media", testMediaDoc);
UpdateStatusWorkitemHandler handler = new UpdateStatusWorkitemHandler("testConsumerKey", "testConsumerSecret", "testAccessKey", "testAccessSecret");
handler.setAuth(auth);
handler.executeWorkItem(workItem, manager);
assertNotNull(manager.getResults());
assertEquals(1, manager.getResults().size());
assertTrue(manager.getResults().containsKey(workItem.getId()));
StatusUpdate handlerStatusUpdate = handler.getStatusUpdate();
assertNotNull(handlerStatusUpdate);
assertEquals("testUpdateStatus", handlerStatusUpdate.getStatus());
}
Aggregations