use of io.syndesis.common.model.action.ConnectorDescriptor in project syndesis by syndesisio.
the class ConnectionActionHandlerTest method shouldNotContactVerifierForNonDynamicActions.
@Test
public void shouldNotContactVerifierForNonDynamicActions() {
final ConnectorDescriptor defaultDefinition = new ConnectorDescriptor.Builder().build();
final Response response = handler.enrichWithMetadata(SALESFORCE_LIMITS, null);
assertThat(response.getStatus()).isEqualTo(Status.OK.getStatusCode());
@SuppressWarnings("unchecked") final Meta<ConnectorDescriptor> returnValue = (Meta<ConnectorDescriptor>) response.getEntity();
assertThat(returnValue.getValue()).isEqualTo(defaultDefinition);
}
use of io.syndesis.common.model.action.ConnectorDescriptor in project syndesis by syndesisio.
the class GenerateMetadataMojo method generateAtlasMapInspections.
// ****************************************
// Inspections
// ****************************************
/**
* Generate atlasmap inspections, no matter if they come from annotations or they are written directly into source json
*/
private void generateAtlasMapInspections() throws MojoExecutionException {
try {
Map<String, Action> processedActions = new TreeMap<>();
for (Map.Entry<String, Action> actionEntry : actions.entrySet()) {
Optional<DataShape> input = generateInspections(actionEntry.getKey(), actionEntry.getValue().getInputDataShape());
Optional<DataShape> output = generateInspections(actionEntry.getKey(), actionEntry.getValue().getOutputDataShape());
Action newAction;
if (Action.TYPE_CONNECTOR.equals(actionEntry.getValue().getActionType())) {
newAction = new ConnectorAction.Builder().createFrom((ConnectorAction) actionEntry.getValue()).descriptor(new ConnectorDescriptor.Builder().createFrom((ConnectorDescriptor) actionEntry.getValue().getDescriptor()).inputDataShape(input).outputDataShape(output).build()).build();
} else if (Action.TYPE_STEP.equals(actionEntry.getValue().getActionType())) {
newAction = new StepAction.Builder().createFrom((StepAction) actionEntry.getValue()).descriptor(new StepDescriptor.Builder().createFrom((StepDescriptor) actionEntry.getValue().getDescriptor()).inputDataShape(input).outputDataShape(output).build()).build();
} else {
throw new IllegalArgumentException("Unsupported action type: " + actionEntry.getValue().getActionType());
}
processedActions.put(actionEntry.getKey(), newAction);
}
this.actions = processedActions;
} catch (@SuppressWarnings("PMD.AvoidCatchingGenericException") Exception ex) {
throw new MojoExecutionException("Error processing atlasmap inspections", ex);
}
}
Aggregations