target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testGenerateProjectErrorHandling() throws Exception { TestResourceManager resourceManager = new TestResourceManager(); Integration integration = resourceManager.newIntegration( new Step.Builder() .stepKind(StepKind.endpoint) .connection(new Connection.Builder() .id("timer-connection") .connector(TestC... | @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorServi... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... |
@Test public void shouldCreateNoShapesForNoShape() { final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(StepMetadataHelper.NO_SHAPE) .build(); final Response response = handler.enrichStepMetadata(StepKind.split.name(), givenMetadata); @S... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldCreateNoShapesForEmptyShapes() { final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder().build(); final Response response = handler.enrichStepMetadata(StepKind.split.name(), givenMetadata); @SuppressWarnings("unchecked") final Meta<StepDescriptor> meta = (Meta<StepDescrip... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldPreserveShapesForUnsupportedShapeKind() { DataShape xmlSchape = new DataShape.Builder() .kind(DataShapeKinds.XML_SCHEMA_INSPECTED) .specification("</>") .putMetadata("something", "else") .build(); final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder() .inputShape(xmlScha... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldPreserveShapesForUnsupportedStepKind() { final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder() .inputShape(dummyShape()) .outputShape(dummyShape()) .build(); final Response response = handler.enrichStepMetadata(StepKind.log.name(), givenMetadata); @SuppressWarnings("unc... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldEnrichSplitSteps() { List<Step> steps = Arrays.asList(new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(new DataShape.Builder() .createFrom(collectionSh... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldEnrichAggregateSteps() { List<Step> steps = Arrays.asList(new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(new DataShape.Builder() .createFrom(collecti... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldPreserveStepsWithShapes() { DataShape dummyShape = dummyShape(); List<Step> steps = Collections.singletonList(new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(dummyShape) .outputDataShape(dummyShap... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldPreserveStepsWithNoShape() { List<Step> steps = Arrays.asList(new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(StepMetadataHelper.NO_SHAPE) .build()) .... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldPropagateShapeChangesToAllPrecedingSteps() { DataShape oldElementShape = new DataShape.Builder() .kind(DataShapeKinds.JAVA) .specification("person-old-spec") .description("person") .type(Person.class.getName()) .putMetadata("variant", "element") .build(); List<Step> steps = Arrays.asList(new Ste... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldCreateMetaDataFromSurroundingSteps() throws IOException { Step previousStep = new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(new DataShape.Builder() ... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); DataShape outputShape = StepMetadataHelper.getLa... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... |
@Test public void testGenerateApplicationProperties() throws IOException { final ConnectorAction newAction = new ConnectorAction.Builder() .id(KeyGenerator.createKey()) .descriptor(new ConnectorDescriptor.Builder() .connectorId("new") .componentScheme("http4") .build()) .build(); final Connector newConnector = new Conn... | @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.getConfiguredProperties()); addPropertiesFrom(properties, in... | ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.ge... | ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.ge... | ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.ge... | ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.ge... |
@Test public void shouldCreateMetaDataFromAnyShapes() { Step previousStep = new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(StepMetadataHelper.ANY_SHAPE) .build()) .build()) ... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); DataShape outputShape = StepMetadataHelper.getLa... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... |
@Test public void shouldCreateMetaDataFromEmptySurroundingSteps() { DynamicActionMetadata metadata = metadataHandler.createMetadata(aggregateStep, Collections.emptyList(), Collections.emptyList()); Assert.assertEquals(StepMetadataHelper.NO_SHAPE, metadata.inputShape()); Assert.assertEquals(StepMetadataHelper.NO_SHAPE, ... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); DataShape outputShape = StepMetadataHelper.getLa... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.N... |
@Test public void shouldExtractJavaOutputCollectionVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JAVA) .specification(getSpecification("person-spec.json")) .descriptio... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldExtractJavaInputElementVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(new DataShape.Builder() .kind(DataShapeKinds.JAVA) .specification(getSpecification("person-list-spec.json")) .description("person-list") .collectionType("List") ... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldExtractJsonSchemaOutputCollectionVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .specification(getSpecification("person-schema.json... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldExtractJsonSchemaInputElementVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .specification(getSpecification("person-list-schema.json")) .description("person-list-schema") .c... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldAutoConvertAndExtractJsonSchemaVariants() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .specification(getSpecification("person-list-schema.json")) .description("person-list-schema")... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldExtractAlreadyGivenJsonSchemaVariants() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .specification(getSpecification("person-schema.json")) .description("person-schema") .type(Perso... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldExtractJsonInstanceOutputCollectionVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_INSTANCE) .specification(getSpecification("person-instanc... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldExtractJsonInstanceInputElementVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .specification(getSpecification("person-list-instance.json")) .description("person-list-instanc... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void testGenerateApplicationPropertiesOldStyle() throws IOException { final ConnectorAction oldAction = new ConnectorAction.Builder() .id(KeyGenerator.createKey()) .descriptor(new ConnectorDescriptor.Builder() .connectorId("old") .build()) .build(); final Connector oldConnector = new Connector.Builder() .i... | @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.getConfiguredProperties()); addPropertiesFrom(properties, in... | ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.ge... | ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.ge... | ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.ge... | ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.ge... |
@Test public void shouldAutoConvertAndExtractJsonInstanceVariants() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_INSTANCE) .specification(getSpecification("person-list-instance.json")) .description("person-list-in... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldExtractAlreadyGivenJsonInstanceVariants() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_INSTANCE) .specification(getSpecification("person-instance.json")) .description("person-instance") .ty... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test @Parameters({"person-list-unified-response-schema.json, person-unified-response-schema.json", "person-list-unified-response-schema-draft-4.json, person-unified-response-schema-draft-4.json", "person-list-unified-response-schema-draft-6.json, person-unified-response-schema-draft-6.json"}) public void shouldAutoCon... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... | AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { DataShape outputShape = metadata.outputShape(); DataShape inputShape = metadata.inputShape(); try { if (metadata.outputShape() != null) { outputShape = adaptOutputShape(new DataShape... |
@Test public void shouldCreateNewConnectorsBasedOnConnectorTemplates() { final Map<String, ConfigurationProperty> properties = new HashMap<>(); properties.put("prop1", new ConfigurationProperty.Builder().build()); final Map<String, ConfigurationProperty> connectorProperties = new HashMap<>(); connectorProperties.put("p... | @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiResponse(responseCode = "200", description = "Newly created Connec... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiRes... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiRes... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiRes... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiRes... |
@Test public void shouldProvideInfoAboutAppliedConnectorSettings() { final CustomConnectorHandler handler = new CustomConnectorHandler(dataManager, applicationContext, iconDao); final ConnectorGenerator connectorGenerator = mock(ConnectorGenerator.class); final ConnectorTemplate template = new ConnectorTemplate.Builder... | @POST @Path("/info") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Provides a summary of the connector as it would be built using a ConnectorTemplate identified by the provided `connector-template-id` and the data given in `connectorSettings`") public APISummary i... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/info") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Provides a summary of the connector as it would be built using a ConnectorTemplate identified by the provided `connector-template-id` ... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/info") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Provides a summary of the connector as it would be built using a ConnectorTemplate identified by the provided `connector-template-id` ... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/info") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Provides a summary of the connector as it would be built using a ConnectorTemplate identified by the provided `connector-template-id` ... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/info") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Provides a summary of the connector as it would be built using a ConnectorTemplate identified by the provided `connector-template-id` ... |
@Test public void shouldThrowEntityNotFoundIfNoConnectorTemplateExists() { assertThatThrownBy(() -> new CustomConnectorHandler(dataManager, applicationContext, iconDao).create( new ConnectorSettings.Builder().connectorTemplateId("non-existent").build()) ).isInstanceOf(EntityNotFoundException.class).hasMessage("Connecto... | @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiResponse(responseCode = "200", description = "Newly created Connec... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiRes... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiRes... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiRes... | CustomConnectorHandler extends BaseConnectorGeneratorHandler { @POST @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Operation(description = "Creates a new Connector based on the ConnectorTemplate identified by the provided `id` and the data given in `connectorSettings`") @ApiRes... |
@Test public void shouldDeleteConnectionsAndDeletingAssociatedResources() { String id = "to-delete"; Connection connection = new Connection.Builder().id(id).build(); when(dataManager.fetch(Connection.class, id)).thenReturn(connection); Set<String> cbbIds = new HashSet<>(); for (int i = 1; i <= 2; ++i) { cbbIds.add(id +... | @Override public void delete(String id) { final DataManager dataManager = getDataManager(); dataManager.fetchIdsByPropertyValue(ConnectionBulletinBoard.class, "targetResourceId", id) .forEach(cbbId -> dataManager.delete(ConnectionBulletinBoard.class, cbbId)); Deleter.super.delete(id); } | ConnectionHandler extends BaseHandler implements Lister<ConnectionOverview>, Getter<ConnectionOverview>, Creator<Connection>, Deleter<Connection>, Updater<Connection>, Validating<Connection> { @Override public void delete(String id) { final DataManager dataManager = getDataManager(); dataManager.fetchIdsByPropertyValue... | ConnectionHandler extends BaseHandler implements Lister<ConnectionOverview>, Getter<ConnectionOverview>, Creator<Connection>, Deleter<Connection>, Updater<Connection>, Validating<Connection> { @Override public void delete(String id) { final DataManager dataManager = getDataManager(); dataManager.fetchIdsByPropertyValue... | ConnectionHandler extends BaseHandler implements Lister<ConnectionOverview>, Getter<ConnectionOverview>, Creator<Connection>, Deleter<Connection>, Updater<Connection>, Validating<Connection> { @Override public void delete(String id) { final DataManager dataManager = getDataManager(); dataManager.fetchIdsByPropertyValue... | ConnectionHandler extends BaseHandler implements Lister<ConnectionOverview>, Getter<ConnectionOverview>, Creator<Connection>, Deleter<Connection>, Updater<Connection>, Validating<Connection> { @Override public void delete(String id) { final DataManager dataManager = getDataManager(); dataManager.fetchIdsByPropertyValue... |
@Test public void shouldAddMetaAndSetStatusToBadRequestIfMetaCallFails() { @SuppressWarnings({"unchecked", "rawtypes"}) final Class<Entity<Map<String, Object>>> entityType = (Class) Entity.class; ArgumentCaptor.forClass(entityType); final DynamicActionMetadata fallback = new DynamicActionMetadata.Builder().build(); whe... | @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(responseCode = "200", content = @C... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... |
@Test public void shouldElicitActionPropertySuggestions() { final DynamicActionMetadata suggestions = new DynamicActionMetadata.Builder() .putProperty("sObjectName", Collections.singletonList(DynamicActionMetadata.ActionPropertySuggestion.Builder.of("Contact", "Contact"))) .putProperty("sObjectIdName", Arrays.asList(Dy... | @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(responseCode = "200", content = @C... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... |
@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()); @SuppressWarni... | @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(responseCode = "200", content = @C... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... |
@Test public void testGenerateApplicationWithOpenApiV2RestDSL() throws Exception { TestResourceManager resourceManager = new TestResourceManager(); URL location = ProjectGeneratorTest.class.getResource("/petstore-v2.json"); byte[] content = Files.readAllBytes(Paths.get(location.toURI())); resourceManager.put("petstore"... | @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorServi... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... |
@Test public void shouldProvideActionDefinition() { @SuppressWarnings({"unchecked", "rawtypes"}) final Class<Entity<Map<String, Object>>> entityType = (Class) Entity.class; ArgumentCaptor.forClass(entityType); final DynamicActionMetadata suggestions = new DynamicActionMetadata.Builder() .putProperty("sObjectName", Arra... | @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(responseCode = "200", content = @C... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... |
@Test public void shouldSetInoutOutputShapesToAnyIfMetadataCallFails() { @SuppressWarnings({"unchecked", "rawtypes"}) final Class<Entity<Map<String, Object>>> entityType = (Class) Entity.class; ArgumentCaptor.forClass(entityType); final DynamicActionMetadata fallback = new DynamicActionMetadata.Builder().build(); when(... | @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(responseCode = "200", content = @C... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... |
@Test public void shouldConvertParameterFromIterableWithStringsToCommaDelimitedString() { final DynamicActionMetadata suggestions = new DynamicActionMetadata.Builder() .putProperty("sObjectName", Arrays.asList(DynamicActionMetadata.ActionPropertySuggestion.Builder.of("Account", "Account"), DynamicActionMetadata.ActionP... | @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(responseCode = "200", content = @C... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... |
@Test public void shouldConvertParameterFromArrayOfStringsToCommaDelimitedString() { final DynamicActionMetadata suggestions = new DynamicActionMetadata.Builder() .putProperty("sObjectName", Arrays.asList(DynamicActionMetadata.ActionPropertySuggestion.Builder.of("Account", "Account"), DynamicActionMetadata.ActionProper... | @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(responseCode = "200", content = @C... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... |
@Test public void shouldSupportOtherParameterTypes() { final DynamicActionMetadata suggestions = new DynamicActionMetadata.Builder() .putProperty("sObjectName", Arrays.asList(DynamicActionMetadata.ActionPropertySuggestion.Builder.of("1", "1"), DynamicActionMetadata.ActionPropertySuggestion.Builder.of("2", "2"))) .build... | @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(responseCode = "200", content = @C... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... | ConnectionActionHandler { @POST @Path(value = "/{actionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched action definition, that is an action definition that has input/output data shapes and property enums defined with respect to the given action properties") @ApiResponse(response... |
@Test public void shouldAugmentWithConnectorUsage() { final Connector connector1 = newConnector("1"); final Connector connector2 = newConnector("2"); final Connector connector3 = newConnector("3"); final Step step1a = new Step.Builder().action(newActionBy(connector1)).build(); final Step step1b = new Step.Builder().act... | Connector augmentedWithUsage(final Connector connector) { if (connector == null) { return null; } return augmentedWithUsage(Collections.singletonList(connector)).get(0); } | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector augmentedWithUsage(final Connector connector) { if (connector == null) { return null; } return augmentedWithUsage(Collections.singletonList(connector)).get(0); } } | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector augmentedWithUsage(final Connector connector) { if (connector == null) { return null; } return augmentedWithUsage(Collections.singletonList(connector)).get(0); } @SuppressWarnings("PMD.ExcessiveParamete... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector augmentedWithUsage(final Connector connector) { if (connector == null) { return null; } return augmentedWithUsage(Collections.singletonList(connector)).get(0); } @SuppressWarnings("PMD.ExcessiveParamete... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector augmentedWithUsage(final Connector connector) { if (connector == null) { return null; } return augmentedWithUsage(Collections.singletonList(connector)).get(0); } @SuppressWarnings("PMD.ExcessiveParamete... |
@Test public void shouldListApiConnectors() { final Connector connector1 = new Connector.Builder().id("1").connectorGroupId("1").build(); final Connector connector2 = new Connector.Builder().id("2").connectorGroupId("2").build(); final List<Connector> connectors = Arrays.asList( connector1, connector2, new Connector.Bu... | @GET @Path("/apiConnectors") @Produces(MediaType.APPLICATION_JSON) public ListResult<Connector> listApiConnectors( @Parameter(required = true, description = "Filter by matching connector group ids") @QueryParam("connectorGroupIdList") List<String> connectorGroupIdList, @Parameter(required = false, description = "Page n... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @GET @Path("/apiConnectors") @Produces(MediaType.APPLICATION_JSON) public ListResult<Connector> listApiConnectors( @Parameter(required = true, description = "Filter by matching connector group ids") @QueryParam("... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @GET @Path("/apiConnectors") @Produces(MediaType.APPLICATION_JSON) public ListResult<Connector> listApiConnectors( @Parameter(required = true, description = "Filter by matching connector group ids") @QueryParam("... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @GET @Path("/apiConnectors") @Produces(MediaType.APPLICATION_JSON) public ListResult<Connector> listApiConnectors( @Parameter(required = true, description = "Filter by matching connector group ids") @QueryParam("... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @GET @Path("/apiConnectors") @Produces(MediaType.APPLICATION_JSON) public ListResult<Connector> listApiConnectors( @Parameter(required = true, description = "Filter by matching connector group ids") @QueryParam("... |
@Test public void shouldDeleteConnectionsWhenDeletingConnector() { when(dataManager.fetchIdsByPropertyValue(Connection.class, "connectorId", "connector-id")) .thenReturn(new HashSet<>(Arrays.asList("connection1", "connection2"))); handler.delete("connector-id"); verify(dataManager).delete(Connector.class, "connector-id... | @Override public void delete(final String id) { Deleter.super.delete(id); getDataManager().fetchIdsByPropertyValue(Connection.class, "connectorId", id) .forEach(connectionId -> getDataManager().delete(Connection.class, connectionId)); } | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @Override public void delete(final String id) { Deleter.super.delete(id); getDataManager().fetchIdsByPropertyValue(Connection.class, "connectorId", id) .forEach(connectionId -> getDataManager().delete(Connection.... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @Override public void delete(final String id) { Deleter.super.delete(id); getDataManager().fetchIdsByPropertyValue(Connection.class, "connectorId", id) .forEach(connectionId -> getDataManager().delete(Connection.... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @Override public void delete(final String id) { Deleter.super.delete(id); getDataManager().fetchIdsByPropertyValue(Connection.class, "connectorId", id) .forEach(connectionId -> getDataManager().delete(Connection.... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @Override public void delete(final String id) { Deleter.super.delete(id); getDataManager().fetchIdsByPropertyValue(Connection.class, "connectorId", id) .forEach(connectionId -> getDataManager().delete(Connection.... |
@Test public void shouldNotFailToEnrichDynamicPropertiesWithNoResponse() { final ConnectorPropertiesHandler connectorPropertiesHandler = mock(ConnectorPropertiesHandler.class); final ConnectorHandler connectorHandler = new ConnectorHandler(dataManager, NO_VERIFIER, NO_CREDENTIALS, NO_INSPECTORS, NO_STATE, NO_ENCRYPTION... | Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationPropertiesWithDynamicProperties( connector.getProperties(), connectorPropertiesHandler.dynamicConnectionProperties(con... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... |
@Test public void shouldEnrichDynamicPropertiesWithResponseFromMeta() { final ConnectorPropertiesHandler connectorPropertiesHandler = mock(ConnectorPropertiesHandler.class); final ConnectorHandler connectorHandler = new ConnectorHandler(dataManager, NO_VERIFIER, NO_CREDENTIALS, NO_INSPECTORS, NO_STATE, NO_ENCRYPTION_CO... | Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationPropertiesWithDynamicProperties( connector.getProperties(), connectorPropertiesHandler.dynamicConnectionProperties(con... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... |
@Test public void testGenerateApplicationWithOpenApiV3RestDSL() throws Exception { TestResourceManager resourceManager = new TestResourceManager(); URL location = ProjectGeneratorTest.class.getResource("/petstore-v3.json"); byte[] content = Files.readAllBytes(Paths.get(location.toURI())); resourceManager.put("petstore"... | @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorServi... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... |
@Test public void shouldEnrichDynamicPropertiesKeepingStaticPropertiesWithResponseFromMeta() { final ConnectorPropertiesHandler connectorPropertiesHandler = mock(ConnectorPropertiesHandler.class); final ConnectorHandler connectorHandler = new ConnectorHandler(dataManager, NO_VERIFIER, NO_CREDENTIALS, NO_INSPECTORS, NO_... | Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationPropertiesWithDynamicProperties( connector.getProperties(), connectorPropertiesHandler.dynamicConnectionProperties(con... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... |
@Test public void shouldNotFailToEnrichDynamicPropertiesWithErrorResponse() { final ConnectorPropertiesHandler connectorPropertiesHandler = mock(ConnectorPropertiesHandler.class); final ConnectorHandler connectorHandler = new ConnectorHandler(dataManager, NO_VERIFIER, NO_CREDENTIALS, NO_INSPECTORS, NO_STATE, NO_ENCRYPT... | Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationPropertiesWithDynamicProperties( connector.getProperties(), connectorPropertiesHandler.dynamicConnectionProperties(con... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { Connector enrichConnectorWithDynamicProperties(Connector connector) { final String connectorId = connector.getId().get(); final Map<String, ConfigurationProperty> dynamicProperties = enrichConfigurationProperties... |
@Test public void shouldVerifyConfiguredProperties() { final EncryptionComponent encryptionComponent = mock(EncryptionComponent.class); final Verifier verifier = new Verifier() { @Override public List<Result> verify(String connectorId, Map<String, String> parameters) { assertThat(parameters).containsEntry("configuredPr... | @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId, final Map<String, String> props) { final Connector connector = get(connectorId); Map<String, String> verif... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId... |
@Test public void shouldVerifyUserPropertiesOverrideConfiguredProperties() { final EncryptionComponent encryptionComponent = mock(EncryptionComponent.class); final Verifier verifier = new Verifier() { @Override public List<Result> verify(String connectorId, Map<String, String> parameters) { assertThat(parameters).conta... | @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId, final Map<String, String> props) { final Connector connector = get(connectorId); Map<String, String> verif... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId... | ConnectorHandler extends BaseHandler implements Getter<Connector>, Updater<Connector>, Deleter<Connector> { @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{id}/verifier") public List<Verifier.Result> verifyConnectionParameters(@NotNull @PathParam("id") final String connectorId... |
@Test public void shouldSendRequestsToMeta() { final MetadataConfigurationProperties config = new MetadataConfigurationProperties(); config.setService("syndesis-meta"); final Client client = mock(Client.class); final ConnectorPropertiesHandler handler = new ConnectorPropertiesHandler(config) { @Override protected Hystr... | @POST @Produces(MediaType.APPLICATION_JSON) public DynamicConnectionPropertiesMetadata dynamicConnectionProperties(@PathParam("id") final String connectorId) { final HystrixExecutable<DynamicConnectionPropertiesMetadata> meta = createMetadataConnectionPropertiesCommand(connectorId); return meta.execute(); } | ConnectorPropertiesHandler { @POST @Produces(MediaType.APPLICATION_JSON) public DynamicConnectionPropertiesMetadata dynamicConnectionProperties(@PathParam("id") final String connectorId) { final HystrixExecutable<DynamicConnectionPropertiesMetadata> meta = createMetadataConnectionPropertiesCommand(connectorId); return ... | ConnectorPropertiesHandler { @POST @Produces(MediaType.APPLICATION_JSON) public DynamicConnectionPropertiesMetadata dynamicConnectionProperties(@PathParam("id") final String connectorId) { final HystrixExecutable<DynamicConnectionPropertiesMetadata> meta = createMetadataConnectionPropertiesCommand(connectorId); return ... | ConnectorPropertiesHandler { @POST @Produces(MediaType.APPLICATION_JSON) public DynamicConnectionPropertiesMetadata dynamicConnectionProperties(@PathParam("id") final String connectorId) { final HystrixExecutable<DynamicConnectionPropertiesMetadata> meta = createMetadataConnectionPropertiesCommand(connectorId); return ... | ConnectorPropertiesHandler { @POST @Produces(MediaType.APPLICATION_JSON) public DynamicConnectionPropertiesMetadata dynamicConnectionProperties(@PathParam("id") final String connectorId) { final HystrixExecutable<DynamicConnectionPropertiesMetadata> meta = createMetadataConnectionPropertiesCommand(connectorId); return ... |
@Test public void successfulWhoAmIWithoutFullName() { SecurityContext sec = mock(SecurityContext.class); Principal principal = mock(Principal.class); when(principal.getName()).thenReturn("testuser"); when(sec.getUserPrincipal()).thenReturn(principal); NamespacedOpenShiftClient client = mock(NamespacedOpenShiftClient.cl... | @Path("~") @GET @Produces(MediaType.APPLICATION_JSON) public User whoAmI(@Context SecurityContext sec) { String username = sec.getUserPrincipal().getName(); io.fabric8.openshift.api.model.User openShiftUser = this.openShiftService.whoAmI(username); Assert.notNull(openShiftUser, "A valid user is required"); return new U... | UserHandler extends BaseHandler implements Lister<User>, Getter<User> { @Path("~") @GET @Produces(MediaType.APPLICATION_JSON) public User whoAmI(@Context SecurityContext sec) { String username = sec.getUserPrincipal().getName(); io.fabric8.openshift.api.model.User openShiftUser = this.openShiftService.whoAmI(username);... | UserHandler extends BaseHandler implements Lister<User>, Getter<User> { @Path("~") @GET @Produces(MediaType.APPLICATION_JSON) public User whoAmI(@Context SecurityContext sec) { String username = sec.getUserPrincipal().getName(); io.fabric8.openshift.api.model.User openShiftUser = this.openShiftService.whoAmI(username);... | UserHandler extends BaseHandler implements Lister<User>, Getter<User> { @Path("~") @GET @Produces(MediaType.APPLICATION_JSON) public User whoAmI(@Context SecurityContext sec) { String username = sec.getUserPrincipal().getName(); io.fabric8.openshift.api.model.User openShiftUser = this.openShiftService.whoAmI(username);... | UserHandler extends BaseHandler implements Lister<User>, Getter<User> { @Path("~") @GET @Produces(MediaType.APPLICATION_JSON) public User whoAmI(@Context SecurityContext sec) { String username = sec.getUserPrincipal().getName(); io.fabric8.openshift.api.model.User openShiftUser = this.openShiftService.whoAmI(username);... |
@Test public void exportResources() throws IOException { final DataManager dataManager = mock(DataManager.class); final Environment env = newEnvironment("env"); final String envId = env.getId().get(); final Integration integration1 = new Integration.Builder() .id("integration1") .putContinuousDeliveryState(envId, new C... | @GET @Path("integrations/{env}/export.zip") @Produces(MediaType.APPLICATION_OCTET_STREAM) @SuppressWarnings("JdkObsolete") public Response exportResources(@NotNull @PathParam("env") @Parameter(required = true) String environment, @QueryParam("all") @Parameter boolean exportAll, @QueryParam("ignoreTimestamp") @Parameter... | PublicApiHandler { @GET @Path("integrations/{env}/export.zip") @Produces(MediaType.APPLICATION_OCTET_STREAM) @SuppressWarnings("JdkObsolete") public Response exportResources(@NotNull @PathParam("env") @Parameter(required = true) String environment, @QueryParam("all") @Parameter boolean exportAll, @QueryParam("ignoreTim... | PublicApiHandler { @GET @Path("integrations/{env}/export.zip") @Produces(MediaType.APPLICATION_OCTET_STREAM) @SuppressWarnings("JdkObsolete") public Response exportResources(@NotNull @PathParam("env") @Parameter(required = true) String environment, @QueryParam("all") @Parameter boolean exportAll, @QueryParam("ignoreTim... | PublicApiHandler { @GET @Path("integrations/{env}/export.zip") @Produces(MediaType.APPLICATION_OCTET_STREAM) @SuppressWarnings("JdkObsolete") public Response exportResources(@NotNull @PathParam("env") @Parameter(required = true) String environment, @QueryParam("all") @Parameter boolean exportAll, @QueryParam("ignoreTim... | PublicApiHandler { @GET @Path("integrations/{env}/export.zip") @Produces(MediaType.APPLICATION_OCTET_STREAM) @SuppressWarnings("JdkObsolete") public Response exportResources(@NotNull @PathParam("env") @Parameter(required = true) String environment, @QueryParam("all") @Parameter boolean exportAll, @QueryParam("ignoreTim... |
@Test public void importResources() { final DataManager dataManager = mock(DataManager.class); final SecurityContext securityContext = newMockSecurityContext(); final InputStream givenDataStream = new ByteArrayInputStream(new byte[0]); final IntegrationSupportHandler supportHandler = mock(IntegrationSupportHandler.clas... | @POST @Path("integrations") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public ContinuousDeliveryImportResults importResources(@Context SecurityContext sec, @NotNull @MultipartForm @Parameter(required = true) ImportFormDa... | PublicApiHandler { @POST @Path("integrations") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public ContinuousDeliveryImportResults importResources(@Context SecurityContext sec, @NotNull @MultipartForm @Parameter(required =... | PublicApiHandler { @POST @Path("integrations") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public ContinuousDeliveryImportResults importResources(@Context SecurityContext sec, @NotNull @MultipartForm @Parameter(required =... | PublicApiHandler { @POST @Path("integrations") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public ContinuousDeliveryImportResults importResources(@Context SecurityContext sec, @NotNull @MultipartForm @Parameter(required =... | PublicApiHandler { @POST @Path("integrations") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public ContinuousDeliveryImportResults importResources(@Context SecurityContext sec, @NotNull @MultipartForm @Parameter(required =... |
@Test public void testAddNewEnvironment() { final DataManager dataManager = mock(DataManager.class); final EnvironmentHandler environmentHandler = new EnvironmentHandler(dataManager); final PublicApiHandler handler = new PublicApiHandler(null, null, null, null, null, environmentHandler, null, null); handler.addNewEnvir... | @POST @Path("environments/{env}") public void addNewEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.addNewEnvironment(environment); } | PublicApiHandler { @POST @Path("environments/{env}") public void addNewEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.addNewEnvironment(environment); } } | PublicApiHandler { @POST @Path("environments/{env}") public void addNewEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.addNewEnvironment(environment); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
Integrati... | PublicApiHandler { @POST @Path("environments/{env}") public void addNewEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.addNewEnvironment(environment); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
Integrati... | PublicApiHandler { @POST @Path("environments/{env}") public void addNewEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.addNewEnvironment(environment); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
Integrati... |
@Test public void testDeleteEnvironment() { final DataManager dataManager = mock(DataManager.class); final Environment env = newEnvironment("env"); when(dataManager.fetchByPropertyValue(Environment.class, "name", "env")).thenReturn(Optional.of(env)); final String envId = env.getId().get(); final Integration integration... | @DELETE @Path("environments/{env}") public void deleteEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteEnvironment(environment); } | PublicApiHandler { @DELETE @Path("environments/{env}") public void deleteEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteEnvironment(environment); } } | PublicApiHandler { @DELETE @Path("environments/{env}") public void deleteEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteEnvironment(environment); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
Integra... | PublicApiHandler { @DELETE @Path("environments/{env}") public void deleteEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteEnvironment(environment); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
Integra... | PublicApiHandler { @DELETE @Path("environments/{env}") public void deleteEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteEnvironment(environment); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
Integra... |
@Test public void testGenerateTemplateStepProjectDependencies() throws Exception { TestResourceManager resourceManager = new TestResourceManager(); Integration integration = resourceManager.newIntegration( new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDes... | @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorServi... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... |
@Test public void testDeleteReleaseTag() { final DataManager dataManager = mock(DataManager.class); final Environment env = newEnvironment("env"); final Integration integration = new Integration.Builder() .putContinuousDeliveryState(env.getId().get(), new ContinuousDeliveryEnvironment.Builder().build()) .build(); when(... | @DELETE @Path("integrations/{id}/tags/{env}") public void deleteReleaseTag(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteReleaseTag(integrationId, environment); } | PublicApiHandler { @DELETE @Path("integrations/{id}/tags/{env}") public void deleteReleaseTag(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteReleaseTag(integrationId, environment); } } | PublicApiHandler { @DELETE @Path("integrations/{id}/tags/{env}") public void deleteReleaseTag(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteReleaseTag(integrationId, environment); } protec... | PublicApiHandler { @DELETE @Path("integrations/{id}/tags/{env}") public void deleteReleaseTag(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteReleaseTag(integrationId, environment); } protec... | PublicApiHandler { @DELETE @Path("integrations/{id}/tags/{env}") public void deleteReleaseTag(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @PathParam("env") @Parameter(required = true) String environment) { environmentHandler.deleteReleaseTag(integrationId, environment); } protec... |
@Test public void testDuplicateRenameEnvironment() { final DataManager dataManager = mock(DataManager.class); final Environment env1 = newEnvironment("env1"); when(dataManager.fetchByPropertyValue(Environment.class, "name", "env1")).thenReturn(Optional.of(env1)); final Environment env2 = newEnvironment("env2"); when(da... | @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironment); } | PublicApiHandler { @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironmen... | PublicApiHandler { @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironmen... | PublicApiHandler { @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironmen... | PublicApiHandler { @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironmen... |
@Test public void testEmptyTagForRelease() { final DataManager dataManager = mock(DataManager.class); final EnvironmentHandler environmentHandler = new EnvironmentHandler(dataManager); final PublicApiHandler handler = new PublicApiHandler(null, null, null, null, null, environmentHandler, null, null); assertThatExceptio... | @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<String> environments)... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... |
@Test public void testGetIntegrationState() { final DataManager dataManager = mock(DataManager.class); final Integration integration = new Integration.Builder() .id("integration-id") .name("integration-name") .build(); when(dataManager.fetch(Integration.class, "integration-name")).thenReturn(integration); final Integra... | @GET @Path("integrations/{id}/state") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public IntegrationState getIntegrationState(@Context SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) String integrationId) { final Integration integration = getIntegration(integra... | PublicApiHandler { @GET @Path("integrations/{id}/state") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public IntegrationState getIntegrationState(@Context SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) String integrationId) { final Integration integration = get... | PublicApiHandler { @GET @Path("integrations/{id}/state") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public IntegrationState getIntegrationState(@Context SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) String integrationId) { final Integration integration = get... | PublicApiHandler { @GET @Path("integrations/{id}/state") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public IntegrationState getIntegrationState(@Context SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) String integrationId) { final Integration integration = get... | PublicApiHandler { @GET @Path("integrations/{id}/state") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public IntegrationState getIntegrationState(@Context SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) String integrationId) { final Integration integration = get... |
@Test public void testGetReleaseEnvironments() { final DataManager dataManager = mock(DataManager.class); when(dataManager.fetchAll(Environment.class)).thenReturn(ListResult.of(newEnvironment("env1"), newEnvironment("env2"))); final EnvironmentHandler environmentHandler = new EnvironmentHandler(dataManager); final Publ... | public List<String> getReleaseEnvironments() { return environmentHandler.getReleaseEnvironments(); } | PublicApiHandler { public List<String> getReleaseEnvironments() { return environmentHandler.getReleaseEnvironments(); } } | PublicApiHandler { public List<String> getReleaseEnvironments() { return environmentHandler.getReleaseEnvironments(); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
IntegrationDeploymentHandler deploymentHandler, ConnectionHandler connectionHandler,
Monitorin... | PublicApiHandler { public List<String> getReleaseEnvironments() { return environmentHandler.getReleaseEnvironments(); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
IntegrationDeploymentHandler deploymentHandler, ConnectionHandler connectionHandler,
Monitorin... | PublicApiHandler { public List<String> getReleaseEnvironments() { return environmentHandler.getReleaseEnvironments(); } protected PublicApiHandler(DataManager dataMgr, EncryptionComponent encryptionComponent,
IntegrationDeploymentHandler deploymentHandler, ConnectionHandler connectionHandler,
Monitorin... |
@Test public void testGetReleaseTags() { final DataManager dataManager = mock(DataManager.class); final Environment env = newEnvironment("env"); final String envId = env.getId().get(); final ContinuousDeliveryEnvironment deliveryEnvironment = new ContinuousDeliveryEnvironment.Builder() .environmentId(envId) .build(); f... | @GET @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> getReleaseTags(@NotNull @PathParam("id") @Parameter(required = true) String integrationId) { return environmentHandler.getReleaseTags(integrationId); } | PublicApiHandler { @GET @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> getReleaseTags(@NotNull @PathParam("id") @Parameter(required = true) String integrationId) { return environmentHandler.getReleaseTags(integrationId); } } | PublicApiHandler { @GET @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> getReleaseTags(@NotNull @PathParam("id") @Parameter(required = true) String integrationId) { return environmentHandler.getReleaseTags(integrationId); } protected PublicApiHand... | PublicApiHandler { @GET @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> getReleaseTags(@NotNull @PathParam("id") @Parameter(required = true) String integrationId) { return environmentHandler.getReleaseTags(integrationId); } protected PublicApiHand... | PublicApiHandler { @GET @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> getReleaseTags(@NotNull @PathParam("id") @Parameter(required = true) String integrationId) { return environmentHandler.getReleaseTags(integrationId); } protected PublicApiHand... |
@Test public void testInvalidTagForRelease() { final DataManager dataManager = mock(DataManager.class); final EnvironmentHandler environmentHandler = new EnvironmentHandler(dataManager); final PublicApiHandler handler = new PublicApiHandler(null, null, null, null, null, environmentHandler, null, null); assertThatExcept... | @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<String> environments)... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... |
@Test public void testPatchTagsForRelease() throws Exception { final DataManager dataManager = mock(DataManager.class); final Environment env1 = newEnvironment("env1"); when(dataManager.fetchByPropertyValue(Environment.class, "name", "env1")) .thenReturn(Optional.of(env1)); when(dataManager.fetch(Environment.class, env... | @PATCH @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> patchTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<String> environme... | PublicApiHandler { @PATCH @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> patchTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) Lis... | PublicApiHandler { @PATCH @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> patchTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) Lis... | PublicApiHandler { @PATCH @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> patchTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) Lis... | PublicApiHandler { @PATCH @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> patchTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) Lis... |
@Test public void testPublishIntegration() { final DataManager dataManager = mock(DataManager.class); final Integration integration = new Integration.Builder() .id("integration-id") .build(); final SecurityContext securityContext = newMockSecurityContext(); when(dataManager.fetch(Integration.class, "integration-id")).t... | @POST @Path("integrations/{id}/deployments") @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment publishIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { return publishIntegration(sec, getIntegration(integrationId)); } | PublicApiHandler { @POST @Path("integrations/{id}/deployments") @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment publishIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { return publishIntegration(sec, getIntegration(inte... | PublicApiHandler { @POST @Path("integrations/{id}/deployments") @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment publishIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { return publishIntegration(sec, getIntegration(inte... | PublicApiHandler { @POST @Path("integrations/{id}/deployments") @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment publishIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { return publishIntegration(sec, getIntegration(inte... | PublicApiHandler { @POST @Path("integrations/{id}/deployments") @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment publishIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { return publishIntegration(sec, getIntegration(inte... |
@Test public void testPutTagsForRelease() throws Exception { final Environment environment = newEnvironment("env"); final Integration integration = new Integration.Builder().build(); final DataManager dataManager = mock(DataManager.class); when(dataManager.fetchByPropertyValue(Environment.class, "name", "env")) .thenRe... | @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<String> environments)... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... |
@Test public void testCreateKey() { String last = KeyGenerator.createKey(); for (int i = 0; i < 1000000; i++) { final String lastKey = last; final String key = KeyGenerator.createKey(); assertThat(key).is(new Condition<>((other) -> lastKey.compareTo(other) < 0, "greater than " + lastKey)); last = key; } } | public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } | KeyGenerator { public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } } | KeyGenerator { public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } private KeyGenerator(); } | KeyGenerator { public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } private KeyGenerator(); static String createKey(... | KeyGenerator { public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } private KeyGenerator(); static String createKey(... |
@Test public void testCompositeJavaDataShape() throws Exception { final ObjectNode ds = new ObjectMapper().createObjectNode(); ds.put("type", "java:" + String.class.getName()); final Optional<DataShape> shape = DataShapeUtils.buildDataShape(ds); assertThat(shape.isPresent()).isTrue(); assertThat(shape.get().getKind()).... | static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); addValueTo(root, "sp... | DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add... | DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add... | DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add... | DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add... |
@Test public void testPutTagsForReleaseByName() throws Exception { final Environment environment = newEnvironment("env"); final Integration integration = new Integration.Builder().build(); final DataManager dataManager = mock(DataManager.class); when(dataManager.fetchByPropertyValue(Environment.class, "name", "env")) .... | @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<String> environments)... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... | PublicApiHandler { @PUT @Path("integrations/{id}/tags") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Map<String, ContinuousDeliveryEnvironment> putTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<St... |
@Test public void testRenameEnvironment() { final DataManager dataManager = mock(DataManager.class); final Environment env = newEnvironment("env"); when(dataManager.fetchByPropertyValue(Environment.class, "name", "env")).thenReturn(Optional.of(env)); final EnvironmentHandler environmentHandler = new EnvironmentHandler(... | @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironment); } | PublicApiHandler { @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironmen... | PublicApiHandler { @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironmen... | PublicApiHandler { @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironmen... | PublicApiHandler { @PUT @Path("environments/{env}") @Consumes(MediaType.APPLICATION_JSON) public void renameEnvironment(@NotNull @PathParam("env") @Parameter(required = true) String environment, @NotNull @Parameter(required = true) String newEnvironment) { environmentHandler.renameEnvironment(environment, newEnvironmen... |
@Test public void testStopIntegration() { final DataManager dataManager = mock(DataManager.class); final Integration integration = new Integration.Builder() .id("integration-id") .build(); final SecurityContext securityContext = newMockSecurityContext(); when(dataManager.fetch(Integration.class, "integration-id")).then... | @PUT @Path("integrations/{id}/deployments/stop") @Produces(MediaType.APPLICATION_JSON) public void stopIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { final Integration integration = getIntegration(integrationId); IntegrationDeploymentH... | PublicApiHandler { @PUT @Path("integrations/{id}/deployments/stop") @Produces(MediaType.APPLICATION_JSON) public void stopIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { final Integration integration = getIntegration(integrationId); Int... | PublicApiHandler { @PUT @Path("integrations/{id}/deployments/stop") @Produces(MediaType.APPLICATION_JSON) public void stopIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { final Integration integration = getIntegration(integrationId); Int... | PublicApiHandler { @PUT @Path("integrations/{id}/deployments/stop") @Produces(MediaType.APPLICATION_JSON) public void stopIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { final Integration integration = getIntegration(integrationId); Int... | PublicApiHandler { @PUT @Path("integrations/{id}/deployments/stop") @Produces(MediaType.APPLICATION_JSON) public void stopIntegration(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String integrationId) { final Integration integration = getIntegration(integrationId); Int... |
@Test public void shouldAddNewFlowsNonTrivialCase() { final Step step = new Step.Builder() .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder().build()) .build()) .build(); final Flow flow1 = new Flow.Builder().putMetadata(OpenApi.OPERATION_ID, "flow1").addSteps(step, step).build(); final... | public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetadata(OpenApi.OPERATION... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... |
@Test public void shouldAddNewFlowsTrivialCase() { final Step step = new Step.Builder() .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder().build()) .build()) .build(); final Flow flow = new Flow.Builder().putMetadata(OpenApi.OPERATION_ID, "flow1").addSteps(step, step).build(); final Int... | public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetadata(OpenApi.OPERATION... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... |
@Test public void shouldDeleteFlowsThatHaveBeenRemovedNonTrivialCase() { final Step step = new Step.Builder() .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder().build()) .build()) .build(); final Flow existingFlow1 = new Flow.Builder().putMetadata(OpenApi.OPERATION_ID, "flow1").addSteps... | public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetadata(OpenApi.OPERATION... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... |
@Test public void shouldDeleteFlowsThatHaveBeenRemovedTrivialCase() { final Step step = new Step.Builder() .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder().build()) .build()) .build(); final Flow existingFlow = new Flow.Builder().id("flow1").addSteps(step, step).build(); final Integra... | public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetadata(OpenApi.OPERATION... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... |
@Test public void shouldUpdateFlowNameAndDescription() { final Step step = new Step.Builder() .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder().build()) .build()) .build(); final Flow flow = new Flow.Builder().putMetadata(OpenApi.OPERATION_ID, "flow1").name("name").description("descrip... | public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetadata(OpenApi.OPERATION... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... |
@Test public void shouldUpdateFlowsDataShapes() { final Step startStep = new Step.Builder() .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .outputDataShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_INSTANCE) .specification("{\"start\":\"existing\"}") .build()) .build()) .bui... | public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetadata(OpenApi.OPERATION... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... |
@Test public void shouldUpdateFlowsStartAndEndDataShapesWithoutChanges() { final Step step = new Step.Builder() .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder().build()) .build()) .build(); final Flow flow = new Flow.Builder().putMetadata(OpenApi.OPERATION_ID, "flow1").addSteps(step, ... | public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetadata(OpenApi.OPERATION... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... | ApiGeneratorHelper { public static Integration updateFlowsAndStartAndEndDataShapes(final Integration existing, final Integration given) { final List<Flow> updatedFlows = new ArrayList<>(given.getFlows().size()); for (final Flow givenFlow : given.getFlows()) { final Optional<String> maybeOperationId = givenFlow.getMetad... |
@Test public void testCreateKeyMultithreaded() { final int count = 100000; final Collection<Callable<String>> tasks = IntStream.range(0, count).boxed() .map(i -> (Callable<String>) () -> KeyGenerator.createKey()).collect(Collectors.toList()); final ForkJoinPool pool = ForkJoinPool.commonPool(); final List<Future<String... | public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } | KeyGenerator { public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } } | KeyGenerator { public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } private KeyGenerator(); } | KeyGenerator { public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } private KeyGenerator(); static String createKey(... | KeyGenerator { public static String createKey() { final long now = clock.getAsLong(); final ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]); buffer.putLong(now); buffer.put(randomnessByte); buffer.putLong(getRandomPart(now)); return encodeKey(buffer.array()); } private KeyGenerator(); static String createKey(... |
@Test public void shouldFetchIntegrationDeployments() { final IntegrationDeployment expected = deployment(0); when(dataManager.fetch(IntegrationDeployment.class, compositeId(INTEGRATION_ID, 3))).thenReturn(expected); final IntegrationDeployment got = handler.get(INTEGRATION_ID, 3); assertThat(got).isEqualTo(expected); ... | @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{version}") public IntegrationDeployment get(@NotNull @PathParam("id") @Parameter(required = true) final String id, @NotNull @PathParam("version") @Parameter(required = true) final int version) { final String compositeId = IntegrationDeployment.compositeId(id, version)... | IntegrationDeploymentHandler extends BaseHandler { @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{version}") public IntegrationDeployment get(@NotNull @PathParam("id") @Parameter(required = true) final String id, @NotNull @PathParam("version") @Parameter(required = true) final int version) { final String composite... | IntegrationDeploymentHandler extends BaseHandler { @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{version}") public IntegrationDeployment get(@NotNull @PathParam("id") @Parameter(required = true) final String id, @NotNull @PathParam("version") @Parameter(required = true) final int version) { final String composite... | IntegrationDeploymentHandler extends BaseHandler { @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{version}") public IntegrationDeployment get(@NotNull @PathParam("id") @Parameter(required = true) final String id, @NotNull @PathParam("version") @Parameter(required = true) final int version) { final String composite... | IntegrationDeploymentHandler extends BaseHandler { @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{version}") public IntegrationDeployment get(@NotNull @PathParam("id") @Parameter(required = true) final String id, @NotNull @PathParam("version") @Parameter(required = true) final int version) { final String composite... |
@Test public void shouldSetVersionTo1ForInitialUpdate() { final SecurityContext security = mock(SecurityContext.class); final Principal principal = mock(Principal.class); when(security.getUserPrincipal()).thenReturn(principal); when(principal.getName()).thenReturn("user"); final Integration integration = new Integratio... | @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration = dataManager.fetch(Integration.class, id); if (inte... | IntegrationDeploymentHandler extends BaseHandler { @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration =... | IntegrationDeploymentHandler extends BaseHandler { @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration =... | IntegrationDeploymentHandler extends BaseHandler { @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration =... | IntegrationDeploymentHandler extends BaseHandler { @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration =... |
@Test public void shouldUpdateIntegrationDeployments() { final SecurityContext security = mock(SecurityContext.class); final Principal principal = mock(Principal.class); when(security.getUserPrincipal()).thenReturn(principal); when(principal.getName()).thenReturn("user"); final Integration integration = new Integration... | @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration = dataManager.fetch(Integration.class, id); if (inte... | IntegrationDeploymentHandler extends BaseHandler { @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration =... | IntegrationDeploymentHandler extends BaseHandler { @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration =... | IntegrationDeploymentHandler extends BaseHandler { @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration =... | IntegrationDeploymentHandler extends BaseHandler { @PUT @Produces(MediaType.APPLICATION_JSON) public IntegrationDeployment update(@Context final SecurityContext sec, @NotNull @PathParam("id") @Parameter(required = true) final String id) { final DataManager dataManager = getDataManager(); final Integration integration =... |
@Test public void shouldNotSetManagementUrlIfEmpty() { Integration integration = new Integration.Builder().id(INTEGRATION_ID).build(); IntegrationDeployment deployment = new IntegrationDeployment.Builder().spec(integration).version(3) .currentState(IntegrationDeploymentState.Published).id(INTEGRATION_DEPLOYMENT_ID).bui... | @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fetchBoard(dataManager, Integr... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... |
@Test public void shouldSetManagementUrl() { Integration integration = new Integration.Builder().id(INTEGRATION_ID).build(); IntegrationDeployment deployment = new IntegrationDeployment.Builder().spec(integration).version(3) .currentState(IntegrationDeploymentState.Published).id(INTEGRATION_DEPLOYMENT_ID).build(); when... | @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fetchBoard(dataManager, Integr... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... |
@Test public void shouldSetExposureMeansIfExposable() { Integration integration = new Integration.Builder().id(INTEGRATION_ID).addFlow( new Flow.Builder().addStep(new Step.Builder().action( new StepAction.Builder().addTag("expose").build()).build()).build()).build(); Set<String> exposureMeans = Sets.newHashSet("ROUTE")... | @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fetchBoard(dataManager, Integr... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... |
@Test public void shouldNotSetExposureMeansIfNotExposable() { Integration integration = new Integration.Builder().id(INTEGRATION_ID).addFlow( new Flow.Builder().addStep(new Step.Builder().action( new StepAction.Builder().build()).build()).build()).build(); Set<String> exposureMeans = Sets.newHashSet("ROUTE"); when(data... | @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fetchBoard(dataManager, Integr... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... | IntegrationOverviewHelper { @SuppressWarnings("PMD.NPathComplexity") IntegrationOverview toCurrentIntegrationOverview(final Integration integration) { final String id = integration.getId().get(); final IntegrationOverview.Builder builder = new IntegrationOverview.Builder().createFrom(integration); DataManagerSupport.fe... |
@Test public void filterOptionsNoOutputShape() { DataShape dataShape = dataShape(DataShapeKinds.NONE); FilterOptions options = handler.getFilterOptions(dataShape); assertThat(options.getPaths()).isEmpty(); } | @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(final DataShape dataShape) { final FilterOptions.Builder builder = new FilterOptions.Builder().addAllOps(Op.DEFAULT_OPTS); final List<String> paths = inspectors.getPaths(dataShape.getKind().toString(), da... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(... |
@Test public void filterOptionsSimple() { when(inspectors.getPaths(DataShapeKinds.JAVA.toString(), "twitter4j.Status", null, Optional.empty())) .thenReturn(Arrays.asList("paramA", "paramB")); DataShape dataShape = dataShape(DataShapeKinds.JAVA, "twitter4j.Status"); FilterOptions options = handler.getFilterOptions(dataS... | @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(final DataShape dataShape) { final FilterOptions.Builder builder = new FilterOptions.Builder().addAllOps(Op.DEFAULT_OPTS); final List<String> paths = inspectors.getPaths(dataShape.getKind().toString(), da... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @POST @Produces(MediaType.APPLICATION_JSON) @Path(value = "/filters/options") public FilterOptions getFilterOptions(... |
@Test public void shouldCreateIntegrations() { final SecurityContext security = mock(SecurityContext.class); final Principal principal = mock(Principal.class); when(security.getUserPrincipal()).thenReturn(principal); when(principal.getName()).thenReturn("user"); final Integration integration = new Integration.Builder()... | @Override public Integration create(@Context final SecurityContext sec, final Integration integration) { final Integration encryptedIntegration = encryptionSupport.encrypt(integration); final Integration updatedIntegration = new Integration.Builder().createFrom(encryptedIntegration) .createdAt(System.currentTimeMillis(... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @Override public Integration create(@Context final SecurityContext sec, final Integration integration) { final Integ... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @Override public Integration create(@Context final SecurityContext sec, final Integration integration) { final Integ... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @Override public Integration create(@Context final SecurityContext sec, final Integration integration) { final Integ... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @Override public Integration create(@Context final SecurityContext sec, final Integration integration) { final Integ... |
@Test public void testGetKeyTimeMillis() throws IOException { long t1 = System.currentTimeMillis(); String key = KeyGenerator.createKey(); long t2 = KeyGenerator.getKeyTimeMillis(key); assertThat(t2).isCloseTo(t1, Offset.offset(500L)); } | public static long getKeyTimeMillis(String key) throws IOException { byte[] decoded = Base64.decode(stripPreAndSuffix(key), Base64.ORDERED); if (decoded.length != 15) { throw new IOException("Invalid key: size is incorrect."); } ByteBuffer buffer = ByteBuffer.allocate(8); buffer.position(2); buffer.put(decoded, 0 ,6); ... | KeyGenerator { public static long getKeyTimeMillis(String key) throws IOException { byte[] decoded = Base64.decode(stripPreAndSuffix(key), Base64.ORDERED); if (decoded.length != 15) { throw new IOException("Invalid key: size is incorrect."); } ByteBuffer buffer = ByteBuffer.allocate(8); buffer.position(2); buffer.put(d... | KeyGenerator { public static long getKeyTimeMillis(String key) throws IOException { byte[] decoded = Base64.decode(stripPreAndSuffix(key), Base64.ORDERED); if (decoded.length != 15) { throw new IOException("Invalid key: size is incorrect."); } ByteBuffer buffer = ByteBuffer.allocate(8); buffer.position(2); buffer.put(d... | KeyGenerator { public static long getKeyTimeMillis(String key) throws IOException { byte[] decoded = Base64.decode(stripPreAndSuffix(key), Base64.ORDERED); if (decoded.length != 15) { throw new IOException("Invalid key: size is incorrect."); } ByteBuffer buffer = ByteBuffer.allocate(8); buffer.position(2); buffer.put(d... | KeyGenerator { public static long getKeyTimeMillis(String key) throws IOException { byte[] decoded = Base64.decode(stripPreAndSuffix(key), Base64.ORDERED); if (decoded.length != 15) { throw new IOException("Invalid key: size is incorrect."); } ByteBuffer buffer = ByteBuffer.allocate(8); buffer.position(2); buffer.put(d... |
@Test public void shouldDeleteIntegrationsAndDeletingAssociatedResources() { String id = "to-delete"; Integration integration = new Integration.Builder().id(id).build(); when(dataManager.fetch(Integration.class, id)).thenReturn(integration); Integration integration1 = new Integration.Builder().createFrom(integration).n... | @Override public void delete(final String id) { final DataManager dataManager = getDataManager(); final Set<String> deploymentNames = dataManager.fetchAllByPropertyValue(IntegrationDeployment.class, "integrationId", id).map(deployment -> { String name = deployment.getSpec().getName(); String depId = deployment.getId().... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @Override public void delete(final String id) { final DataManager dataManager = getDataManager(); final Set<String> ... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @Override public void delete(final String id) { final DataManager dataManager = getDataManager(); final Set<String> ... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @Override public void delete(final String id) { final DataManager dataManager = getDataManager(); final Set<String> ... | IntegrationHandler extends BaseHandler implements Lister<IntegrationOverview>, Getter<IntegrationOverview>,
Creator<Integration>, Deleter<Integration>, Updater<Integration>, Validating<Integration> { @Override public void delete(final String id) { final DataManager dataManager = getDataManager(); final Set<String> ... |
@Test public void ifNoSpecificationIsPresentShouldRespondWithNotFound() { when(dataManager.fetch(Integration.class, "integration-id")).thenReturn(new Integration.Builder().build()); try (Response response = handler.fetch("integration-id")) { assertThat(response.getStatus()).isEqualTo(Status.NOT_FOUND.getStatusCode()); ... | @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definining this integration") @ApiResponse... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... |
@Test public void shouldServeSpecifications() { final byte[] specificationBytes = "this is the specification".getBytes(StandardCharsets.UTF_8); when(dataManager.fetch(Integration.class, "integration-id")).thenReturn( new Integration.Builder() .addResource( new ResourceIdentifier.Builder() .id("resource-id") .kind(Kind.... | @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definining this integration") @ApiResponse... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... |
@Test public void shouldServeSpecificationsWithoutContentTypeMeta() { final byte[] specificationBytes = "this is the specification".getBytes(StandardCharsets.UTF_8); when(dataManager.fetch(Integration.class, "integration-id")).thenReturn( new Integration.Builder() .addResource( new ResourceIdentifier.Builder() .id("res... | @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definining this integration") @ApiResponse... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... | IntegrationSpecificationHandler { @GET @Operation(description = "Responds with specification that defines this integration") @ApiResponse(responseCode = "404", description = "No specification resource defines this integration") @ApiResponse(responseCode = "204", description = "Empty specification provided when definini... |
@Test public void shouldFilterEmptyResults() { assertThat(filter.apply(ListResult.of(emptyList()))).isEmpty(); } | @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems().stream() .filter(i -> i.getSpec().idEquals(integrationId)).collect(Collectors.toList()); return ListResult.of(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... |
@Test public void shouldFilterOutTrivialWantedDeployments() { assertThat(filter.apply(ListResult.of(wanted))).containsOnly(wanted); } | @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems().stream() .filter(i -> i.getSpec().idEquals(integrationId)).collect(Collectors.toList()); return ListResult.of(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... |
@Test public void shouldFilterOutWantedDeployments() { assertThat(filter.apply(ListResult.of(unwanted, wanted, unwanted))).containsOnly(wanted); } | @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems().stream() .filter(i -> i.getSpec().idEquals(integrationId)).collect(Collectors.toList()); return ListResult.of(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... |
@Test public void shouldFilterOutWantedDeploymentsNotFinding() { assertThat(filter.apply(ListResult.of(unwanted, unwanted, unwanted))).isEmpty(); } | @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems().stream() .filter(i -> i.getSpec().idEquals(integrationId)).collect(Collectors.toList()); return ListResult.of(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... | IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> { @Override public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) { if (integrationId == null) { return list; } final List<IntegrationDeployment> filtered = list.getItems(... |
@Test public void shouldFilterOutNonOAuthConnectors() { final Connector connector1 = new Connector.Builder().build(); final Connector connector2 = new Connector.Builder() .putProperty("clientId", new ConfigurationProperty.Builder().addTag(Credentials.CLIENT_ID_TAG).build()) .putConfiguredProperty("clientId", "my-client... | @Override public ListResult<Connector> apply(final ListResult<Connector> result) { final List<Connector> oauthConnectors = result.getItems().stream() .filter(c -> c.propertyEntryTaggedWith(Credentials.CLIENT_ID_TAG).isPresent()).collect(Collectors.toList()); return ListResult.of(oauthConnectors); } | OAuthConnectorFilter implements Function<ListResult<Connector>, ListResult<Connector>> { @Override public ListResult<Connector> apply(final ListResult<Connector> result) { final List<Connector> oauthConnectors = result.getItems().stream() .filter(c -> c.propertyEntryTaggedWith(Credentials.CLIENT_ID_TAG).isPresent()).co... | OAuthConnectorFilter implements Function<ListResult<Connector>, ListResult<Connector>> { @Override public ListResult<Connector> apply(final ListResult<Connector> result) { final List<Connector> oauthConnectors = result.getItems().stream() .filter(c -> c.propertyEntryTaggedWith(Credentials.CLIENT_ID_TAG).isPresent()).co... | OAuthConnectorFilter implements Function<ListResult<Connector>, ListResult<Connector>> { @Override public ListResult<Connector> apply(final ListResult<Connector> result) { final List<Connector> oauthConnectors = result.getItems().stream() .filter(c -> c.propertyEntryTaggedWith(Credentials.CLIENT_ID_TAG).isPresent()).co... | OAuthConnectorFilter implements Function<ListResult<Connector>, ListResult<Connector>> { @Override public ListResult<Connector> apply(final ListResult<Connector> result) { final List<Connector> oauthConnectors = result.getItems().stream() .filter(c -> c.propertyEntryTaggedWith(Credentials.CLIENT_ID_TAG).isPresent()).co... |
@Test public void createSupportZipFileTest() throws IOException { final NamespacedOpenShiftClient client = mock(NamespacedOpenShiftClient.class); final MixedOperation<Pod, PodList, DoneablePod, PodResource<Pod, DoneablePod>> pods = mock(mixedOperationType()); when(pods.list()).thenReturn(new PodList()); when(client.pod... | public File createSupportZipFile(Map<String, Boolean> configurationMap, int page, int perPage) { File zipFile = null; try { zipFile = File.createTempFile("syndesis.", ".zip"); } catch (IOException e) { log.error("Error creating Support zip file", e); throw new WebApplicationException(e, 500); } try (ZipOutputStream os ... | SupportUtil { public File createSupportZipFile(Map<String, Boolean> configurationMap, int page, int perPage) { File zipFile = null; try { zipFile = File.createTempFile("syndesis.", ".zip"); } catch (IOException e) { log.error("Error creating Support zip file", e); throw new WebApplicationException(e, 500); } try (ZipOu... | SupportUtil { public File createSupportZipFile(Map<String, Boolean> configurationMap, int page, int perPage) { File zipFile = null; try { zipFile = File.createTempFile("syndesis.", ".zip"); } catch (IOException e) { log.error("Error creating Support zip file", e); throw new WebApplicationException(e, 500); } try (ZipOu... | SupportUtil { public File createSupportZipFile(Map<String, Boolean> configurationMap, int page, int perPage) { File zipFile = null; try { zipFile = File.createTempFile("syndesis.", ".zip"); } catch (IOException e) { log.error("Error creating Support zip file", e); throw new WebApplicationException(e, 500); } try (ZipOu... | SupportUtil { public File createSupportZipFile(Map<String, Boolean> configurationMap, int page, int perPage) { File zipFile = null; try { zipFile = File.createTempFile("syndesis.", ".zip"); } catch (IOException e) { log.error("Error creating Support zip file", e); throw new WebApplicationException(e, 500); } try (ZipOu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.