use of org.apache.camel.component.bonita.api.model.UploadFileResponse in project camel by apache.
the class BonitaAPIUtilPrepareInputsTest method testPrepareInputsOneFile.
@Test
public void testPrepareInputsOneFile() throws Exception {
Map<String, Serializable> rawInputs = new HashMap<String, Serializable>();
FileInput file = new FileInput("filename", "String".getBytes());
rawInputs.put("myVariable", 1);
rawInputs.put("filename", file);
BonitaAPIUtil bonitaApiUtilMod = Mockito.spy(bonitaApiUtil);
UploadFileResponse uploadFileResponse = new UploadFileResponse();
uploadFileResponse.setTempPath("temp");
Mockito.doReturn(uploadFileResponse).when(bonitaApiUtilMod).uploadFile(Matchers.any(), Matchers.any());
Map<String, Serializable> inputs = bonitaApiUtilMod.prepareInputs(processDefinition, rawInputs);
assertEquals(rawInputs.size(), inputs.size());
}
use of org.apache.camel.component.bonita.api.model.UploadFileResponse in project camel by apache.
the class BonitaAPIUtilPrepareInputsTest method testPrepareInputsFileType.
@Test
public void testPrepareInputsFileType() throws Exception {
Map<String, Serializable> rawInputs = new HashMap<String, Serializable>();
FileInput file = new FileInput("filename", "String".getBytes());
rawInputs.put("filename", file);
BonitaAPIUtil bonitaApiUtilMod = Mockito.spy(bonitaApiUtil);
UploadFileResponse uploadFileResponse = new UploadFileResponse();
uploadFileResponse.setTempPath("temp");
Mockito.doReturn(uploadFileResponse).when(bonitaApiUtilMod).uploadFile(Matchers.any(), Matchers.any());
Map<String, Serializable> inputs = bonitaApiUtilMod.prepareInputs(processDefinition, rawInputs);
assertTrue(Map.class.isInstance(inputs.get("filename")));
}
use of org.apache.camel.component.bonita.api.model.UploadFileResponse in project camel by apache.
the class BonitaAPIUtilPrepareInputsTest method testPrepareInputsTempFilePath.
@Test
public void testPrepareInputsTempFilePath() throws Exception {
Map<String, Serializable> rawInputs = new HashMap<String, Serializable>();
FileInput file = new FileInput("filename", "String".getBytes());
rawInputs.put("filename", file);
BonitaAPIUtil bonitaApiUtilMod = Mockito.spy(bonitaApiUtil);
UploadFileResponse uploadFileResponse = new UploadFileResponse();
uploadFileResponse.setTempPath("temp");
Mockito.doReturn(uploadFileResponse).when(bonitaApiUtilMod).uploadFile(Matchers.any(), Matchers.any());
Map<String, Serializable> inputs = bonitaApiUtilMod.prepareInputs(processDefinition, rawInputs);
Map<String, Serializable> fileMap = (Map<String, Serializable>) inputs.get("filename");
assertEquals("temp", fileMap.get("tempPath"));
}
Aggregations