@@ -5,12 +5,12 @@ import akka.http.scaladsl.model.StatusCodes
5
5
import akka .http .scaladsl .model .headers .OAuth2BearerToken
6
6
import akka .http .scaladsl .server .Route .{seal => sealRoute }
7
7
import bio .terra .workspace .client .ApiException
8
- import bio .terra .workspace .model .{ CloningInstructionsEnum , DataReferenceDescription , DataReferenceList , DataRepoSnapshot , ReferenceTypeEnum , UpdateDataReferenceRequestBody }
8
+ import bio .terra .workspace .model ._
9
9
import org .broadinstitute .dsde .rawls .dataaccess .{MockGoogleServicesDAO , SlickDataSource }
10
10
import org .broadinstitute .dsde .rawls .google .MockGooglePubSubDAO
11
11
import org .broadinstitute .dsde .rawls .mock .{MockSamDAO , MockWorkspaceManagerDAO }
12
12
import org .broadinstitute .dsde .rawls .model .DataReferenceModelJsonSupport ._
13
- import org .broadinstitute .dsde .rawls .model .{ DataReferenceDescriptionField , DataReferenceName , ErrorReport , NamedDataRepoSnapshot , SamResourceAction , SamResourceTypeName , SamWorkspaceActions , UserInfo }
13
+ import org .broadinstitute .dsde .rawls .model ._
14
14
import org .broadinstitute .dsde .rawls .openam .MockUserInfoDirectives
15
15
16
16
import scala .collection .JavaConverters ._
@@ -22,7 +22,7 @@ class SnapshotApiServiceSpec extends ApiServiceSpec {
22
22
23
23
val defaultNamedSnapshotJson = httpJson(NamedDataRepoSnapshot (
24
24
name = DataReferenceName (" foo" ),
25
- description = DataReferenceDescriptionField (" bar" ),
25
+ description = Option ( DataReferenceDescriptionField (" bar" ) ),
26
26
snapshotId = " realsnapshot"
27
27
))
28
28
val defaultSnapshotUpdateBodyJson = httpJson(new UpdateDataReferenceRequestBody ().name(" foo2" ).description(" bar2" ))
@@ -110,7 +110,7 @@ class SnapshotApiServiceSpec extends ApiServiceSpec {
110
110
Post (baseSnapshotsPath, httpJson(
111
111
NamedDataRepoSnapshot (
112
112
name = DataReferenceName (" foo" ),
113
- description = DataReferenceDescriptionField (" bar" ),
113
+ description = Option ( DataReferenceDescriptionField (" bar" ) ),
114
114
snapshotId = " fakesnapshot"
115
115
)
116
116
)) ~>
@@ -221,7 +221,7 @@ class SnapshotApiServiceSpec extends ApiServiceSpec {
221
221
Post (baseSnapshotsPath, httpJson(
222
222
NamedDataRepoSnapshot (
223
223
name = DataReferenceName (" bar" ),
224
- description = DataReferenceDescriptionField (" bar" ),
224
+ description = Option ( DataReferenceDescriptionField (" bar" ) ),
225
225
snapshotId = " realsnapshot2"
226
226
)
227
227
)) ~>
@@ -327,7 +327,7 @@ class SnapshotApiServiceSpec extends ApiServiceSpec {
327
327
328
328
it should " return 404 when a user tries to update a snapshot from a workspace that they don't have access to" in withTestDataApiServicesAndUser(" no-access" ) { services =>
329
329
val dataReference = new DataRepoSnapshot ().instanceName(" foo" ).snapshot(" bar" )
330
- val id = services.workspaceManagerDAO.createDataReference(UUID .fromString(testData.workspace.workspaceId), DataReferenceName (" test" ), DataReferenceDescriptionField (" description" ), ReferenceTypeEnum .DATA_REPO_SNAPSHOT , dataReference, CloningInstructionsEnum .NOTHING , OAuth2BearerToken (" foo" )).getReferenceId
330
+ val id = services.workspaceManagerDAO.createDataReference(UUID .fromString(testData.workspace.workspaceId), DataReferenceName (" test" ), Option ( DataReferenceDescriptionField (" description" ) ), ReferenceTypeEnum .DATA_REPO_SNAPSHOT , dataReference, CloningInstructionsEnum .NOTHING , OAuth2BearerToken (" foo" )).getReferenceId
331
331
Patch (s " ${baseSnapshotsPath}/ ${id.toString}" , defaultSnapshotUpdateBodyJson) ~>
332
332
sealRoute(services.snapshotRoutes) ~>
333
333
check { assertResult(StatusCodes .NotFound ) {status} }
@@ -374,7 +374,7 @@ class SnapshotApiServiceSpec extends ApiServiceSpec {
374
374
375
375
it should " return 404 when a user tries to delete a snapshot from a workspace that they don't have access to" in withTestDataApiServicesAndUser(" no-access" ) { services =>
376
376
val dataReference = new DataRepoSnapshot ().instanceName(" foo" ).snapshot(" bar" )
377
- val id = services.workspaceManagerDAO.createDataReference(UUID .fromString(testData.workspace.workspaceId), DataReferenceName (" test" ), DataReferenceDescriptionField (" description" ), ReferenceTypeEnum .DATA_REPO_SNAPSHOT , dataReference, CloningInstructionsEnum .NOTHING , OAuth2BearerToken (" foo" )).getReferenceId
377
+ val id = services.workspaceManagerDAO.createDataReference(UUID .fromString(testData.workspace.workspaceId), DataReferenceName (" test" ), Option ( DataReferenceDescriptionField (" description" ) ), ReferenceTypeEnum .DATA_REPO_SNAPSHOT , dataReference, CloningInstructionsEnum .NOTHING , OAuth2BearerToken (" foo" )).getReferenceId
378
378
Delete (s " ${baseSnapshotsPath}/ ${id.toString}" ) ~>
379
379
sealRoute(services.snapshotRoutes) ~>
380
380
check { assertResult(StatusCodes .NotFound ) {status} }
0 commit comments