From 4a1e18718456d6b7dea4f0aa4cd937c47fb9a669 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Wed, 21 Sep 2022 16:00:39 -0500 Subject: [PATCH 1/6] Remove unused webbackend search code. --- airbyte-api/src/main/openapi/config.yaml | 21 - .../airbyte/server/apis/ConfigurationApi.java | 5 - .../WebBackendConnectionsHandler.java | 13 - .../api/generated-api-html/index.html | 368 ------------------ 4 files changed, 407 deletions(-) diff --git a/airbyte-api/src/main/openapi/config.yaml b/airbyte-api/src/main/openapi/config.yaml index 73602e3714e05..7ab576191d2bc 100644 --- a/airbyte-api/src/main/openapi/config.yaml +++ b/airbyte-api/src/main/openapi/config.yaml @@ -2014,27 +2014,6 @@ paths: $ref: "#/components/schemas/WebBackendConnectionRead" "422": $ref: "#/components/responses/InvalidInputResponse" - /v1/web_backend/connections/search: - post: - tags: - - web_backend - summary: Search connections - operationId: webBackendSearchConnections - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/WebBackendConnectionSearch" - required: true - responses: - "200": - description: Successful operation - content: - application/json: - schema: - $ref: "#/components/schemas/WebBackendConnectionReadList" - "422": - $ref: "#/components/responses/InvalidInputResponse" /v1/web_backend/state/get_type: post: tags: diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java b/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java index 2e9e44eab4b5c..e7b5fdd0ec1c2 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java @@ -818,11 +818,6 @@ public WebBackendConnectionReadList webBackendListAllConnectionsForWorkspace(fin return execute(() -> webBackendConnectionsHandler.webBackendListAllConnectionsForWorkspace(workspaceIdRequestBody)); } - @Override - public WebBackendConnectionReadList webBackendSearchConnections(final WebBackendConnectionSearch webBackendConnectionSearch) { - return execute(() -> webBackendConnectionsHandler.webBackendSearchConnections(webBackendConnectionSearch)); - } - @Override public WebBackendConnectionRead webBackendGetConnection(final WebBackendConnectionRequestBody webBackendConnectionRequestBody) { return execute(() -> webBackendConnectionsHandler.webBackendGetConnection(webBackendConnectionRequestBody)); diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java b/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java index 0607d444c7323..9ea8ea7363788 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java @@ -177,19 +177,6 @@ private static WebBackendConnectionRead getWebBackendConnectionRead(final Connec .resourceRequirements(connectionRead.getResourceRequirements()); } - public WebBackendConnectionReadList webBackendSearchConnections(final WebBackendConnectionSearch webBackendConnectionSearch) - throws ConfigNotFoundException, IOException, JsonValidationException { - - final List reads = Lists.newArrayList(); - for (final ConnectionRead connectionRead : connectionsHandler.listConnections().getConnections()) { - if (connectionsHandler.matchSearch(toConnectionSearch(webBackendConnectionSearch), connectionRead)) { - reads.add(buildWebBackendConnectionRead(connectionRead)); - } - } - - return new WebBackendConnectionReadList().connections(reads); - } - // todo (cgardens) - This logic is a headache to follow it stems from the internal data model not // tracking selected streams in any reasonable way. We should update that. public WebBackendConnectionRead webBackendGetConnection(final WebBackendConnectionRequestBody webBackendConnectionRequestBody) diff --git a/docs/reference/api/generated-api-html/index.html b/docs/reference/api/generated-api-html/index.html index 04a1d182de9f4..33234baed41f0 100644 --- a/docs/reference/api/generated-api-html/index.html +++ b/docs/reference/api/generated-api-html/index.html @@ -370,7 +370,6 @@

WebBackend

  • post /v1/web_backend/workspace/state
  • post /v1/web_backend/connections/list_all
  • post /v1/web_backend/connections/list
  • -
  • post /v1/web_backend/connections/search
  • post /v1/web_backend/connections/update
  • Workspace

    @@ -9417,373 +9416,6 @@

    422

    InvalidInputExceptionInfo
    -
    -
    - Up -
    post /v1/web_backend/connections/search
    -
    Search connections (webBackendSearchConnections)
    -
    - - -

    Consumes

    - This API call consumes the following media types via the Content-Type request header: -
      -
    • application/json
    • -
    - -

    Request body

    -
    -
    WebBackendConnectionSearch WebBackendConnectionSearch (required)
    - -
    Body Parameter
    - -
    - - - - -

    Return type

    - - - - -

    Example data

    -
    Content-Type: application/json
    -
    {
    -  "connections" : [ {
    -    "sourceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -    "latestSyncJobCreatedAt" : 0,
    -    "prefix" : "prefix",
    -    "destination" : {
    -      "connectionConfiguration" : {
    -        "user" : "charles"
    -      },
    -      "destinationName" : "destinationName",
    -      "name" : "name",
    -      "destinationDefinitionId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "destinationId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "workspaceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
    -    },
    -    "isSyncing" : true,
    -    "source" : {
    -      "sourceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "connectionConfiguration" : {
    -        "user" : "charles"
    -      },
    -      "name" : "name",
    -      "sourceDefinitionId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "sourceName" : "sourceName",
    -      "workspaceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
    -    },
    -    "destinationId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -    "catalogDiff" : {
    -      "transforms" : [ {
    -        "streamDescriptor" : {
    -          "name" : "name",
    -          "namespace" : "namespace"
    -        },
    -        "transformType" : "add_stream",
    -        "updateStream" : [ {
    -          "updateFieldSchema" : { },
    -          "fieldName" : [ "fieldName", "fieldName" ],
    -          "addField" : { },
    -          "transformType" : "add_field",
    -          "removeField" : { }
    -        }, {
    -          "updateFieldSchema" : { },
    -          "fieldName" : [ "fieldName", "fieldName" ],
    -          "addField" : { },
    -          "transformType" : "add_field",
    -          "removeField" : { }
    -        } ]
    -      }, {
    -        "streamDescriptor" : {
    -          "name" : "name",
    -          "namespace" : "namespace"
    -        },
    -        "transformType" : "add_stream",
    -        "updateStream" : [ {
    -          "updateFieldSchema" : { },
    -          "fieldName" : [ "fieldName", "fieldName" ],
    -          "addField" : { },
    -          "transformType" : "add_field",
    -          "removeField" : { }
    -        }, {
    -          "updateFieldSchema" : { },
    -          "fieldName" : [ "fieldName", "fieldName" ],
    -          "addField" : { },
    -          "transformType" : "add_field",
    -          "removeField" : { }
    -        } ]
    -      } ]
    -    },
    -    "resourceRequirements" : {
    -      "cpu_limit" : "cpu_limit",
    -      "memory_request" : "memory_request",
    -      "memory_limit" : "memory_limit",
    -      "cpu_request" : "cpu_request"
    -    },
    -    "schedule" : {
    -      "units" : 0,
    -      "timeUnit" : "minutes"
    -    },
    -    "operations" : [ {
    -      "name" : "name",
    -      "operationId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "operatorConfiguration" : {
    -        "normalization" : {
    -          "option" : "basic"
    -        },
    -        "dbt" : {
    -          "gitRepoBranch" : "gitRepoBranch",
    -          "dockerImage" : "dockerImage",
    -          "dbtArguments" : "dbtArguments",
    -          "gitRepoUrl" : "gitRepoUrl"
    -        }
    -      },
    -      "workspaceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
    -    }, {
    -      "name" : "name",
    -      "operationId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "operatorConfiguration" : {
    -        "normalization" : {
    -          "option" : "basic"
    -        },
    -        "dbt" : {
    -          "gitRepoBranch" : "gitRepoBranch",
    -          "dockerImage" : "dockerImage",
    -          "dbtArguments" : "dbtArguments",
    -          "gitRepoUrl" : "gitRepoUrl"
    -        }
    -      },
    -      "workspaceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
    -    } ],
    -    "catalogId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -    "name" : "name",
    -    "syncCatalog" : {
    -      "streams" : [ {
    -        "stream" : {
    -          "sourceDefinedPrimaryKey" : [ [ "sourceDefinedPrimaryKey", "sourceDefinedPrimaryKey" ], [ "sourceDefinedPrimaryKey", "sourceDefinedPrimaryKey" ] ],
    -          "supportedSyncModes" : [ null, null ],
    -          "sourceDefinedCursor" : true,
    -          "name" : "name",
    -          "namespace" : "namespace",
    -          "defaultCursorField" : [ "defaultCursorField", "defaultCursorField" ]
    -        },
    -        "config" : {
    -          "aliasName" : "aliasName",
    -          "cursorField" : [ "cursorField", "cursorField" ],
    -          "selected" : true,
    -          "primaryKey" : [ [ "primaryKey", "primaryKey" ], [ "primaryKey", "primaryKey" ] ]
    -        }
    -      }, {
    -        "stream" : {
    -          "sourceDefinedPrimaryKey" : [ [ "sourceDefinedPrimaryKey", "sourceDefinedPrimaryKey" ], [ "sourceDefinedPrimaryKey", "sourceDefinedPrimaryKey" ] ],
    -          "supportedSyncModes" : [ null, null ],
    -          "sourceDefinedCursor" : true,
    -          "name" : "name",
    -          "namespace" : "namespace",
    -          "defaultCursorField" : [ "defaultCursorField", "defaultCursorField" ]
    -        },
    -        "config" : {
    -          "aliasName" : "aliasName",
    -          "cursorField" : [ "cursorField", "cursorField" ],
    -          "selected" : true,
    -          "primaryKey" : [ [ "primaryKey", "primaryKey" ], [ "primaryKey", "primaryKey" ] ]
    -        }
    -      } ]
    -    },
    -    "connectionId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -    "namespaceFormat" : "${SOURCE_NAMESPACE}",
    -    "operationIds" : [ null, null ],
    -    "scheduleData" : {
    -      "cron" : {
    -        "cronExpression" : "cronExpression",
    -        "cronTimeZone" : "cronTimeZone"
    -      },
    -      "basicSchedule" : {
    -        "units" : 6,
    -        "timeUnit" : "minutes"
    -      }
    -    }
    -  }, {
    -    "sourceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -    "latestSyncJobCreatedAt" : 0,
    -    "prefix" : "prefix",
    -    "destination" : {
    -      "connectionConfiguration" : {
    -        "user" : "charles"
    -      },
    -      "destinationName" : "destinationName",
    -      "name" : "name",
    -      "destinationDefinitionId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "destinationId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "workspaceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
    -    },
    -    "isSyncing" : true,
    -    "source" : {
    -      "sourceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "connectionConfiguration" : {
    -        "user" : "charles"
    -      },
    -      "name" : "name",
    -      "sourceDefinitionId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "sourceName" : "sourceName",
    -      "workspaceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
    -    },
    -    "destinationId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -    "catalogDiff" : {
    -      "transforms" : [ {
    -        "streamDescriptor" : {
    -          "name" : "name",
    -          "namespace" : "namespace"
    -        },
    -        "transformType" : "add_stream",
    -        "updateStream" : [ {
    -          "updateFieldSchema" : { },
    -          "fieldName" : [ "fieldName", "fieldName" ],
    -          "addField" : { },
    -          "transformType" : "add_field",
    -          "removeField" : { }
    -        }, {
    -          "updateFieldSchema" : { },
    -          "fieldName" : [ "fieldName", "fieldName" ],
    -          "addField" : { },
    -          "transformType" : "add_field",
    -          "removeField" : { }
    -        } ]
    -      }, {
    -        "streamDescriptor" : {
    -          "name" : "name",
    -          "namespace" : "namespace"
    -        },
    -        "transformType" : "add_stream",
    -        "updateStream" : [ {
    -          "updateFieldSchema" : { },
    -          "fieldName" : [ "fieldName", "fieldName" ],
    -          "addField" : { },
    -          "transformType" : "add_field",
    -          "removeField" : { }
    -        }, {
    -          "updateFieldSchema" : { },
    -          "fieldName" : [ "fieldName", "fieldName" ],
    -          "addField" : { },
    -          "transformType" : "add_field",
    -          "removeField" : { }
    -        } ]
    -      } ]
    -    },
    -    "resourceRequirements" : {
    -      "cpu_limit" : "cpu_limit",
    -      "memory_request" : "memory_request",
    -      "memory_limit" : "memory_limit",
    -      "cpu_request" : "cpu_request"
    -    },
    -    "schedule" : {
    -      "units" : 0,
    -      "timeUnit" : "minutes"
    -    },
    -    "operations" : [ {
    -      "name" : "name",
    -      "operationId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "operatorConfiguration" : {
    -        "normalization" : {
    -          "option" : "basic"
    -        },
    -        "dbt" : {
    -          "gitRepoBranch" : "gitRepoBranch",
    -          "dockerImage" : "dockerImage",
    -          "dbtArguments" : "dbtArguments",
    -          "gitRepoUrl" : "gitRepoUrl"
    -        }
    -      },
    -      "workspaceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
    -    }, {
    -      "name" : "name",
    -      "operationId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -      "operatorConfiguration" : {
    -        "normalization" : {
    -          "option" : "basic"
    -        },
    -        "dbt" : {
    -          "gitRepoBranch" : "gitRepoBranch",
    -          "dockerImage" : "dockerImage",
    -          "dbtArguments" : "dbtArguments",
    -          "gitRepoUrl" : "gitRepoUrl"
    -        }
    -      },
    -      "workspaceId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
    -    } ],
    -    "catalogId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -    "name" : "name",
    -    "syncCatalog" : {
    -      "streams" : [ {
    -        "stream" : {
    -          "sourceDefinedPrimaryKey" : [ [ "sourceDefinedPrimaryKey", "sourceDefinedPrimaryKey" ], [ "sourceDefinedPrimaryKey", "sourceDefinedPrimaryKey" ] ],
    -          "supportedSyncModes" : [ null, null ],
    -          "sourceDefinedCursor" : true,
    -          "name" : "name",
    -          "namespace" : "namespace",
    -          "defaultCursorField" : [ "defaultCursorField", "defaultCursorField" ]
    -        },
    -        "config" : {
    -          "aliasName" : "aliasName",
    -          "cursorField" : [ "cursorField", "cursorField" ],
    -          "selected" : true,
    -          "primaryKey" : [ [ "primaryKey", "primaryKey" ], [ "primaryKey", "primaryKey" ] ]
    -        }
    -      }, {
    -        "stream" : {
    -          "sourceDefinedPrimaryKey" : [ [ "sourceDefinedPrimaryKey", "sourceDefinedPrimaryKey" ], [ "sourceDefinedPrimaryKey", "sourceDefinedPrimaryKey" ] ],
    -          "supportedSyncModes" : [ null, null ],
    -          "sourceDefinedCursor" : true,
    -          "name" : "name",
    -          "namespace" : "namespace",
    -          "defaultCursorField" : [ "defaultCursorField", "defaultCursorField" ]
    -        },
    -        "config" : {
    -          "aliasName" : "aliasName",
    -          "cursorField" : [ "cursorField", "cursorField" ],
    -          "selected" : true,
    -          "primaryKey" : [ [ "primaryKey", "primaryKey" ], [ "primaryKey", "primaryKey" ] ]
    -        }
    -      } ]
    -    },
    -    "connectionId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    -    "namespaceFormat" : "${SOURCE_NAMESPACE}",
    -    "operationIds" : [ null, null ],
    -    "scheduleData" : {
    -      "cron" : {
    -        "cronExpression" : "cronExpression",
    -        "cronTimeZone" : "cronTimeZone"
    -      },
    -      "basicSchedule" : {
    -        "units" : 6,
    -        "timeUnit" : "minutes"
    -      }
    -    }
    -  } ]
    -}
    - -

    Produces

    - This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. -
      -
    • application/json
    • -
    - -

    Responses

    -

    200

    - Successful operation - WebBackendConnectionReadList -

    422

    - Input failed validation - InvalidInputExceptionInfo -
    -
    Up From 0465585bd5a59dcaac2845242034d4de8778367b Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Wed, 21 Sep 2022 16:08:31 -0500 Subject: [PATCH 2/6] Remove unused request body. --- airbyte-api/src/main/openapi/config.yaml | 33 ------------------- .../airbyte/server/apis/ConfigurationApi.java | 1 - 2 files changed, 34 deletions(-) diff --git a/airbyte-api/src/main/openapi/config.yaml b/airbyte-api/src/main/openapi/config.yaml index 7ab576191d2bc..5ce839475bc51 100644 --- a/airbyte-api/src/main/openapi/config.yaml +++ b/airbyte-api/src/main/openapi/config.yaml @@ -3400,39 +3400,6 @@ components: $ref: "#/components/schemas/SourceSearch" destination: $ref: "#/components/schemas/DestinationSearch" - WebBackendConnectionSearch: - type: object - properties: - connectionId: - $ref: "#/components/schemas/ConnectionId" - name: - type: string - namespaceDefinition: - $ref: "#/components/schemas/NamespaceDefinitionType" - namespaceFormat: - type: string - description: Used when namespaceDefinition is 'customformat'. If blank then behaves like namespaceDefinition = 'destination'. If "${SOURCE_NAMESPACE}" then behaves like namespaceDefinition = 'source'. - default: null - example: "${SOURCE_NAMESPACE}" - prefix: - type: string - description: Prefix that will be prepended to the name of each stream when it is written to the destination. - sourceId: - $ref: "#/components/schemas/SourceId" - destinationId: - $ref: "#/components/schemas/DestinationId" - schedule: - $ref: "#/components/schemas/ConnectionSchedule" - scheduleType: - $ref: "#/components/schemas/ConnectionScheduleType" - scheduleData: - $ref: "#/components/schemas/ConnectionScheduleData" - status: - $ref: "#/components/schemas/ConnectionStatus" - source: - $ref: "#/components/schemas/SourceSearch" - destination: - $ref: "#/components/schemas/DestinationSearch" ConnectionReadList: type: object required: diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java b/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java index e7b5fdd0ec1c2..aeb452e779e6b 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java @@ -89,7 +89,6 @@ import io.airbyte.api.model.generated.WebBackendConnectionRead; import io.airbyte.api.model.generated.WebBackendConnectionReadList; import io.airbyte.api.model.generated.WebBackendConnectionRequestBody; -import io.airbyte.api.model.generated.WebBackendConnectionSearch; import io.airbyte.api.model.generated.WebBackendConnectionUpdate; import io.airbyte.api.model.generated.WebBackendWorkspaceState; import io.airbyte.api.model.generated.WebBackendWorkspaceStateResult; From b53e71076cb5968cb59ec47d0416d6ef9c399278 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Wed, 21 Sep 2022 16:15:02 -0500 Subject: [PATCH 3/6] Remove unused request body. --- .../api/generated-api-html/index.html | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/docs/reference/api/generated-api-html/index.html b/docs/reference/api/generated-api-html/index.html index 33234baed41f0..0f12bf405611b 100644 --- a/docs/reference/api/generated-api-html/index.html +++ b/docs/reference/api/generated-api-html/index.html @@ -10395,7 +10395,6 @@

    Table of Contents

  • WebBackendConnectionRead -
  • WebBackendConnectionReadList -
  • WebBackendConnectionRequestBody -
  • -
  • WebBackendConnectionSearch -
  • WebBackendConnectionUpdate -
  • WebBackendOperationCreateOrUpdate -
  • WebBackendWorkspaceState -
  • @@ -11811,25 +11810,6 @@

    WebBackendConnectionRequestB
    connectionId
    UUID format: uuid

    -
    -

    WebBackendConnectionSearch - Up

    -
    -
    -
    connectionId (optional)
    UUID format: uuid
    -
    name (optional)
    -
    namespaceDefinition (optional)
    -
    namespaceFormat (optional)
    String Used when namespaceDefinition is 'customformat'. If blank then behaves like namespaceDefinition = 'destination'. If "${SOURCE_NAMESPACE}" then behaves like namespaceDefinition = 'source'.
    -
    prefix (optional)
    String Prefix that will be prepended to the name of each stream when it is written to the destination.
    -
    sourceId (optional)
    UUID format: uuid
    -
    destinationId (optional)
    UUID format: uuid
    -
    schedule (optional)
    -
    scheduleType (optional)
    -
    scheduleData (optional)
    -
    status (optional)
    -
    source (optional)
    -
    destination (optional)
    -
    -

    WebBackendConnectionUpdate - Up

    Used to apply a patch-style update to a connection, which means that null properties remain unchanged
    From 14ac2b16b9f67c2085afeca166dbfc5828962591 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Wed, 21 Sep 2022 20:00:55 -0500 Subject: [PATCH 4/6] Remove failing test. --- .../WebBackendConnectionsHandlerTest.java | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java b/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java index b1b6e155237cc..a5a5efff0ac91 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java +++ b/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java @@ -316,27 +316,6 @@ void testWebBackendListAllConnectionsForWorkspace() throws ConfigNotFoundExcepti assertEquals(expected, WebBackendConnectionReadList.getConnections().get(0)); } - @Test - void testWebBackendSearchConnections() throws ConfigNotFoundException, IOException, JsonValidationException { - final ConnectionReadList connectionReadList = new ConnectionReadList(); - connectionReadList.setConnections(Collections.singletonList(connectionRead)); - final ConnectionIdRequestBody connectionIdRequestBody = new ConnectionIdRequestBody(); - connectionIdRequestBody.setConnectionId(connectionRead.getConnectionId()); - - when(operationsHandler.listOperationsForConnection(connectionIdRequestBody)).thenReturn(operationReadList); - when(connectionsHandler.listConnections()).thenReturn(connectionReadList); - when(connectionsHandler.matchSearch(new ConnectionSearch(), connectionRead)).thenReturn(true); - - final WebBackendConnectionSearch webBackendConnectionSearch = new WebBackendConnectionSearch(); - WebBackendConnectionReadList webBackendConnectionReadList = wbHandler.webBackendSearchConnections(webBackendConnectionSearch); - assertEquals(1, webBackendConnectionReadList.getConnections().size()); - assertEquals(expected, webBackendConnectionReadList.getConnections().get(0)); - - when(connectionsHandler.matchSearch(new ConnectionSearch(), connectionRead)).thenReturn(false); - webBackendConnectionReadList = wbHandler.webBackendSearchConnections(webBackendConnectionSearch); - assertEquals(0, webBackendConnectionReadList.getConnections().size()); - } - @Test void testWebBackendGetConnection() throws ConfigNotFoundException, IOException, JsonValidationException { final ConnectionIdRequestBody connectionIdRequestBody = new ConnectionIdRequestBody(); From 497a8ae3e3db633ea2a63ca07fbe51a9505a4296 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Wed, 21 Sep 2022 20:04:26 -0500 Subject: [PATCH 5/6] Remove failing test. --- .../server/handlers/WebBackendConnectionsHandlerTest.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java b/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java index a0e2e07fae17f..c9d23a4d4c40c 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java +++ b/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java @@ -29,7 +29,6 @@ import io.airbyte.api.model.generated.ConnectionReadList; import io.airbyte.api.model.generated.ConnectionSchedule; import io.airbyte.api.model.generated.ConnectionSchedule.TimeUnitEnum; -import io.airbyte.api.model.generated.ConnectionSearch; import io.airbyte.api.model.generated.ConnectionState; import io.airbyte.api.model.generated.ConnectionStateType; import io.airbyte.api.model.generated.ConnectionStatus; @@ -60,7 +59,6 @@ import io.airbyte.api.model.generated.WebBackendConnectionRead; import io.airbyte.api.model.generated.WebBackendConnectionReadList; import io.airbyte.api.model.generated.WebBackendConnectionRequestBody; -import io.airbyte.api.model.generated.WebBackendConnectionSearch; import io.airbyte.api.model.generated.WebBackendConnectionUpdate; import io.airbyte.api.model.generated.WebBackendOperationCreateOrUpdate; import io.airbyte.api.model.generated.WebBackendWorkspaceState; From 0e56291ca304bc1e716f15f12f4589deeece3457 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Fri, 23 Sep 2022 12:16:16 -0500 Subject: [PATCH 6/6] Remove failing test. --- .../WebBackendConnectionsHandler.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java b/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java index 5dbfb56e62163..749feba5f62d0 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java @@ -16,7 +16,6 @@ import io.airbyte.api.model.generated.ConnectionCreate; import io.airbyte.api.model.generated.ConnectionIdRequestBody; import io.airbyte.api.model.generated.ConnectionRead; -import io.airbyte.api.model.generated.ConnectionSearch; import io.airbyte.api.model.generated.ConnectionStateType; import io.airbyte.api.model.generated.ConnectionUpdate; import io.airbyte.api.model.generated.DestinationIdRequestBody; @@ -35,7 +34,6 @@ import io.airbyte.api.model.generated.WebBackendConnectionRead; import io.airbyte.api.model.generated.WebBackendConnectionReadList; import io.airbyte.api.model.generated.WebBackendConnectionRequestBody; -import io.airbyte.api.model.generated.WebBackendConnectionSearch; import io.airbyte.api.model.generated.WebBackendConnectionUpdate; import io.airbyte.api.model.generated.WebBackendOperationCreateOrUpdate; import io.airbyte.api.model.generated.WebBackendWorkspaceState; @@ -529,24 +527,6 @@ protected static ConnectionUpdate toConnectionPatch(final WebBackendConnectionUp return connectionPatch; } - @VisibleForTesting - protected static ConnectionSearch toConnectionSearch(final WebBackendConnectionSearch webBackendConnectionSearch) { - return new ConnectionSearch() - .name(webBackendConnectionSearch.getName()) - .connectionId(webBackendConnectionSearch.getConnectionId()) - .source(webBackendConnectionSearch.getSource()) - .sourceId(webBackendConnectionSearch.getSourceId()) - .destination(webBackendConnectionSearch.getDestination()) - .destinationId(webBackendConnectionSearch.getDestinationId()) - .namespaceDefinition(webBackendConnectionSearch.getNamespaceDefinition()) - .namespaceFormat(webBackendConnectionSearch.getNamespaceFormat()) - .prefix(webBackendConnectionSearch.getPrefix()) - .schedule(webBackendConnectionSearch.getSchedule()) - .scheduleType(webBackendConnectionSearch.getScheduleType()) - .scheduleData(webBackendConnectionSearch.getScheduleData()) - .status(webBackendConnectionSearch.getStatus()); - } - @VisibleForTesting static List getStreamsToReset(final CatalogDiff catalogDiff) { return catalogDiff.getTransforms().stream().map(StreamTransform::getStreamDescriptor).toList();