Skip to content

Commit

Permalink
[PP-1987]Remove optional or reserved for future use tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyhu-db committed Oct 12, 2024
1 parent 14daf98 commit 3aa7f2a
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 493 deletions.
70 changes: 0 additions & 70 deletions api-doc/Apis/AccountApi.md

This file was deleted.

30 changes: 0 additions & 30 deletions api-doc/Apis/ConnectionApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,3 @@ All URIs are relative to *https://domainnameofpartner*
- **Content-Type**: application/json
- **Accept**: application/json

<a name="testConnection"></a>
# **testConnection**
> ConnectionTestResult testConnection(User-Agent, ConnectionInfo, Accept-Language, Content-Type)


Test the connection created by calling connect endpoint. This api is currently only used in automated tests. In the future it may be included in the partner connect experience.

### Parameters

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **User-Agent** | **String**| The user agent making the call. This will be set to databricks. | [default to databricks] [enum: databricks] |
| **ConnectionInfo** | [**ConnectionInfo**](../Models/ConnectionInfo.md)| | |
| **Accept-Language** | **String**| Preferred language | [optional] [default to en-US] |
| **Content-Type** | **String**| Content type | [optional] [default to application/json; charset&#x3D;utf-8] |

### Return type

[**ConnectionTestResult**](../Models/ConnectionTestResult.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

55 changes: 2 additions & 53 deletions src/main/scala/com/databricks/partnerconnect/example/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ import akka.stream.{ActorMaterializer, Materializer}
import com.databricks.partnerconnect.example.formatters.JsonFormatters._
import com.databricks.partnerconnect.example.handlers.{
ConnectHandler,
DeleteAccountHandler,
DeleteConnectionHandler,
ExpireAccountHandler,
GetConnectorHandler,
TestConnectionHandler
GetConnectorHandler
}
import com.databricks.partnerconnect.example.service.{
AccountService,
Expand All @@ -27,9 +24,7 @@ import com.databricks.partnerconnect.example.util.ServiceLogger.withRequestLoggi
import com.databricks.partnerconnect.example.validators.{
ConnectValidator,
ConnectionInfoValidator,
DeleteAccountValidator,
DeleteConnectionRequestValidator,
ExpireAccountValidator
DeleteConnectionRequestValidator
}
import com.typesafe.scalalogging.Logger
import org.openapitools.client.model.{
Expand Down Expand Up @@ -60,17 +55,10 @@ case class Server(config: PartnerConfig) {
val connectionHandler =
new ConnectHandler(accountService, connectionService, config)
val deleteConnectionHandler = new DeleteConnectionHandler(connectionService)
val deleteAccountHandler =
new DeleteAccountHandler(accountService, connectionService)
val expireAccountHandler =
new ExpireAccountHandler(accountService)
val connectValidator = new ConnectValidator(config)
val connectionInfoValidator = new ConnectionInfoValidator()
val deleteConnectionRequestValidator = new DeleteConnectionRequestValidator()
val deleteAccountValidator = new DeleteAccountValidator()
val testConnectionHandler = new TestConnectionHandler(connectionService)
val getConnectorHandler = new GetConnectorHandler(config)
val expireAccountValidator = new ExpireAccountValidator()

def startServer(): Unit = {
val route = handleRejections(rejectionHandler) {
Expand Down Expand Up @@ -111,42 +99,6 @@ case class Server(config: PartnerConfig) {
}
}

val deleteAccountRoute: Route = path("delete-account") {
delete {
entity(as[AccountInfo]) { account =>
val validation =
deleteAccountValidator.validate(account)
validate(validation.valid, validation.toString) {
deleteAccountHandler.handle(account)
}
}
}
}

val expireAccountRoute: Route = path("expire-account") {
put {
entity(as[AccountUserInfo]) { accountUser =>
val validation =
expireAccountValidator.validate(accountUser)
validate(validation.valid, validation.toString) {
expireAccountHandler.handle(accountUser)
}
}
}
}

val testConnectionRoute: Route = path("test-connection") {
post {
entity(as[ConnectionInfo]) { connectionInfo =>
val validation =
connectionInfoValidator.validate(connectionInfo)
validate(validation.valid, validation.toString) {
testConnectionHandler.handle(connectionInfo)
}
}
}
}

val getConnectorsRoute: Route = path("connectors") {
get {
parameter("pagination_token") { p =>
Expand Down Expand Up @@ -185,9 +137,6 @@ case class Server(config: PartnerConfig) {
concat(
connectRoute,
deleteConnectionRoute,
expireAccountRoute,
deleteAccountRoute,
testConnectionRoute,
getConnectorsRoute
)
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3aa7f2a

Please sign in to comment.