Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
6f9edcf8
Commit
6f9edcf8
authored
1 year ago
by
piotr.kupczyk@id.ethz.ch
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-13784 : V3 API : Cannot remove a property type which already has some values - tests
parent
74dcd1e9
No related branches found
No related tags found
1 merge request
!40
SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateEntityTypeTest.java
+33
-0
33 additions, 0 deletions
...sis/openbis/systemtest/asapi/v3/UpdateEntityTypeTest.java
with
33 additions
and
0 deletions
server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateEntityTypeTest.java
+
33
−
0
View file @
6f9edcf8
...
@@ -612,6 +612,39 @@ public abstract class UpdateEntityTypeTest<CREATION extends IEntityTypeCreation,
...
@@ -612,6 +612,39 @@ public abstract class UpdateEntityTypeTest<CREATION extends IEntityTypeCreation,
"Can not remove property type "
+
propertyType
+
" from type "
+
typeId
.
getPermId
());
"Can not remove property type "
+
propertyType
+
" from type "
+
typeId
.
getPermId
());
}
}
@DataProvider
public
Object
[][]
testRemovePropertyTypeAssignmentWithEntitiesWithSuchPropertyAndForceFlagProvider
()
{
return
new
Object
[][]
{
{
DataType
.
VARCHAR
,
"abc"
},
{
DataType
.
INTEGER
,
"123"
},
{
DataType
.
DATE
,
"2023-06-21"
},
{
DataType
.
TIMESTAMP
,
"2023-06-21 12:07:01"
}
};
}
@Test
(
dataProvider
=
"testRemovePropertyTypeAssignmentWithEntitiesWithSuchPropertyAndForceFlagProvider"
)
public
void
testRemovePropertyTypeAssignmentWithEntitiesWithSuchPropertyAndForceFlag
(
DataType
propertyDataType
,
String
propertyValue
)
{
// Given
String
sessionToken
=
v3api
.
login
(
TEST_USER
,
PASSWORD
);
EntityTypePermId
typeId
=
getTypeId
();
PropertyTypePermId
propertyTypeId
=
createAPropertyType
(
sessionToken
,
propertyDataType
);
PropertyAssignmentCreation
assignmentCreation
=
new
PropertyAssignmentCreation
();
assignmentCreation
.
setPropertyTypeId
(
propertyTypeId
);
UPDATE
updateAddAssignment
=
newTypeUpdate
();
updateAddAssignment
.
setTypeId
(
typeId
);
updateAddAssignment
.
getPropertyAssignments
().
add
(
assignmentCreation
);
updateTypes
(
sessionToken
,
List
.
of
(
updateAddAssignment
));
createEntity
(
sessionToken
,
typeId
,
propertyTypeId
.
getPermId
(),
propertyValue
);
UPDATE
updateRemoveAssignment
=
newTypeUpdate
();
updateRemoveAssignment
.
setTypeId
(
typeId
);
updateRemoveAssignment
.
getPropertyAssignments
().
remove
(
new
PropertyAssignmentPermId
(
typeId
,
propertyTypeId
));
updateRemoveAssignment
.
getPropertyAssignments
().
setForceRemovingAssignments
(
true
);
updateTypes
(
sessionToken
,
List
.
of
(
updateRemoveAssignment
));
}
@Test
@Test
public
void
testAddAlreadyExistingPropertyTypeAssignment
()
public
void
testAddAlreadyExistingPropertyTypeAssignment
()
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment