@Test public void operationSpecifiesExecutionType() { operation.setExecutionType(CPU_INTENSIVE); enrichAndExpect(CPU_INTENSIVE); }
private OperationDeclaration buildUnauthorizeOperation() { OperationDeclaration operation = new OperationDeclaration(UNAUTHORIZE_OPERATION_NAME); operation.setDescription("Deletes all the access token information of a given resource owner id so that it's impossible to " + "execute any operation for that user without doing the authorization dance again"); operation.setBlocking(true); operation.setExecutionType(BLOCKING); operation.setOutput(toDeclaration(voidType)); operation.setOutputAttributes(toDeclaration(voidType)); operation.setRequiresConnection(false); operation.setSupportsStreaming(false); operation.setTransactional(false); operation.addModelProperty(new ComponentExecutorModelProperty((model, params) -> new UnauthorizeOperationExecutor())); ParameterGroupDeclaration group = operation.getParameterGroup(DEFAULT_GROUP_NAME); group.showInDsl(false); ParameterDeclaration parameter = new ParameterDeclaration(RESOURCE_OWNER_ID_PARAMETER_NAME); parameter.setDescription("The id of the resource owner which access should be invalidated"); parameter.setExpressionSupport(SUPPORTED); parameter.setLayoutModel(LayoutModel.builder().build()); parameter.setRequired(false); parameter.setParameterRole(BEHAVIOUR); parameter.setType(stringType, false); group.addParameter(parameter); return operation; }
private OperationDeclaration buildUnauthorizeOperation() { OperationDeclaration operation = new OperationDeclaration(UNAUTHORIZE_OPERATION_NAME); operation.setDescription("Deletes all the access token information of a given resource owner id so that it's impossible to " + "execute any operation for that user without doing the authorization dance again"); operation.setBlocking(true); operation.setExecutionType(BLOCKING); operation.setOutput(toDeclaration(voidType)); operation.setOutputAttributes(toDeclaration(voidType)); operation.setRequiresConnection(false); operation.setSupportsStreaming(false); operation.setTransactional(false); operation.addModelProperty(new ComponentExecutorModelProperty((model, params) -> new UnauthorizeOperationExecutor())); ParameterGroupDeclaration group = operation.getParameterGroup(DEFAULT_GROUP_NAME); group.showInDsl(false); ParameterDeclaration parameter = new ParameterDeclaration(RESOURCE_OWNER_ID_PARAMETER_NAME); parameter.setDescription("The id of the resource owner which access should be invalidated"); parameter.setExpressionSupport(SUPPORTED); parameter.setLayoutModel(LayoutModel.builder().build()); parameter.setRequired(false); parameter.setParameterRole(BEHAVIOUR); parameter.setType(stringType, false); group.addParameter(parameter); return operation; }