Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PP-1987]Remove optional or reserved for future use tests #72

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading