Skip to content

Commit

Permalink
finish replacing workspace api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blakery committed Sep 16, 2024
1 parent be4ccf0 commit 434a6f1
Show file tree
Hide file tree
Showing 3 changed files with 303 additions and 2,798 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ trait WorkspaceApiService extends UserInfoDirectives {
}
} ~
path("workspaces" / Segment / Segment) { (workspaceNamespace, workspaceName) =>
/* we enforce a 6-character minimum for workspaceNamespace, as part of billing project creation.
the previous "mc", "tags", and "id" paths rely on this convention to avoid path-matching conflicts.
we might want to change the first Segment above to a regex a la """[^/.]{6,}""".r
but note that would be a behavior change: if a user entered fewer than 6 chars it would result in an
unmatched path rejection instead of the custom error handling inside WorkspaceService.
*/

patch {
entity(as[Array[AttributeUpdateOperation]]) { operations =>
complete {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package org.broadinstitute.dsde.rawls.webservice

import akka.actor.ActorSystem
import akka.http.scaladsl.model.headers.OAuth2BearerToken
import akka.http.scaladsl.server
import akka.http.scaladsl.server.Directives.{provide, _}
import akka.http.scaladsl.server.Directive1
import akka.http.scaladsl.server.Route.{seal => sealRoute}
import akka.http.scaladsl.server._
import akka.stream.Materializer
import io.opentelemetry.context.Context
import org.broadinstitute.dsde.rawls.billing._
Expand All @@ -14,7 +13,13 @@ import org.broadinstitute.dsde.rawls.dataaccess._
import org.broadinstitute.dsde.rawls.entities.EntityService
import org.broadinstitute.dsde.rawls.genomics.GenomicsService
import org.broadinstitute.dsde.rawls.methods.MethodConfigurationService
import org.broadinstitute.dsde.rawls.model.{ApplicationVersion, RawlsRequestContext, RawlsUserEmail, RawlsUserSubjectId, UserInfo}
import org.broadinstitute.dsde.rawls.model.{
ApplicationVersion,
RawlsRequestContext,
RawlsUserEmail,
RawlsUserSubjectId,
UserInfo
}
import org.broadinstitute.dsde.rawls.snapshot.SnapshotService
import org.broadinstitute.dsde.rawls.spendreporting.SpendReportingService
import org.broadinstitute.dsde.rawls.status.StatusService
Expand Down Expand Up @@ -77,4 +82,9 @@ class MockApiService(

override def requireUserInfo(otelContext: Option[Context]): Directive1[UserInfo] = provide(userInfo)

def testRoutes: server.Route =
(handleExceptions(RawlsApiService.exceptionHandler) & handleRejections(RawlsApiService.rejectionHandler)) {
baseApiRoutes(Context.root())
}

}
Loading

0 comments on commit 434a6f1

Please sign in to comment.