use of com.google.cloud.tasks.v2.Task in project openstack4j by ContainX.
the class ImageV2Tests method createTask.
public void createTask() throws IOException {
respondWith(TASK_JSON);
Map<String, Object> input = new HashMap<>();
input.put("test", "hi");
String type = "import";
Task t = Builders.taskBuilder().type(type).input(input).build();
Task task = osv3().imagesV2().tasks().create(t);
assertNotNull(task);
assertEquals(task.getType(), type);
}
use of com.google.cloud.tasks.v2.Task in project kie-wb-common by kiegroup.
the class FlowElementConverterTest method convertSupported.
@Test
public void convertSupported() {
StartEvent startEvent = mock(StartEvent.class);
tested.convertNode(startEvent);
verify(startEventConverter).convert(startEvent);
EndEvent endEvent = mock(EndEvent.class);
tested.convertNode(endEvent);
verify(endEventConverter).convert(endEvent);
BoundaryEvent boundaryEvent = mock(BoundaryEvent.class);
tested.convertNode(boundaryEvent);
verify(eventConverter).convertBoundaryEvent(boundaryEvent);
IntermediateCatchEvent intermediateCatchEvent = mock(IntermediateCatchEvent.class);
tested.convertNode(intermediateCatchEvent);
verify(eventConverter).convert(intermediateCatchEvent);
IntermediateThrowEvent intermediateThrowEvent = mock(IntermediateThrowEvent.class);
tested.convertNode(intermediateThrowEvent);
verify(throwEventConverter).convert(intermediateThrowEvent);
Task task = mock(Task.class);
tested.convertNode(task);
verify(taskConverter).convert(task);
Gateway gateway = mock(Gateway.class);
tested.convertNode(gateway);
verify(gatewayConverter).convert(gateway);
SubProcess subProcess = mock(SubProcess.class);
tested.convertNode(subProcess);
verify(subProcessConverter).convertSubProcess(subProcess);
CallActivity callActivity = mock(CallActivity.class);
tested.convertNode(callActivity);
verify(callActivityConverter).convert(callActivity);
TextAnnotation textAnnotation = mock(TextAnnotation.class);
tested.convertNode(textAnnotation);
verify(artifactsConverter).convert(textAnnotation);
DataObjectReference dataObjectReference = mock(DataObjectReference.class);
tested.convertNode(dataObjectReference);
verify(artifactsConverter).convert(dataObjectReference);
}
use of com.google.cloud.tasks.v2.Task in project kie-wb-common by kiegroup.
the class TaskConverter method noneTask.
private PropertyWriter noneTask(Node<View<NoneTask>, ?> n) {
Task task = bpmn2.createTask();
task.setId(n.getUUID());
NoneTask definition = n.getContent().getDefinition();
ActivityPropertyWriter p = propertyWriterFactory.of(task);
TaskGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAbsoluteBounds(n);
p.setSimulationSet(definition.getSimulationSet());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
return p;
}
use of com.google.cloud.tasks.v2.Task in project kie-wb-common by kiegroup.
the class TaskConverter method customTask.
private PropertyWriter customTask(Node<View<CustomTask>, ?> n) {
org.eclipse.bpmn2.Task task = bpmn2.createTask();
task.setId(n.getUUID());
CustomTask definition = n.getContent().getDefinition();
ServiceTaskPropertyWriter p = propertyWriterFactory.of(task);
p.setServiceTaskName(definition.getName());
TaskGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
CustomTaskExecutionSet executionSet = definition.getExecutionSet();
p.setTaskName(executionSet.getTaskName().getValue());
p.setAsync(executionSet.getIsAsync().getValue());
p.setOnEntryAction(executionSet.getOnEntryAction());
p.setOnExitAction(executionSet.getOnExitAction());
p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue());
p.setSlaDueDate(executionSet.getSlaDueDate().getValue());
p.setSimulationSet(definition.getSimulationSet());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAbsoluteBounds(n);
return p;
}
use of com.google.cloud.tasks.v2.Task in project kie-wb-common by kiegroup.
the class ActivityPropertyWriterTest method testNotEmptyInputSet.
@Test
public void testNotEmptyInputSet() {
Task task = bpmn2.createTask();
ActivityPropertyWriter activityPropertyWriter = new ActivityPropertyWriter(task, new FlatVariableScope(), new HashSet<>());
activityPropertyWriter.setAssignmentsInfo(new AssignmentsInfo("|A:String|||"));
assertNotNull(task.getIoSpecification());
assertTrue(task.getIoSpecification().getOutputSets().isEmpty());
assertEquals(1, task.getIoSpecification().getInputSets().size());
}
Aggregations