Add notFound suppor (& test) for assign REST (#1902)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -206,8 +206,8 @@ public class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest
|
||||
assertThatThrownBy(() -> distributionSetManagement.assignTag(withMissing, tag.getId()))
|
||||
.matches(e -> {
|
||||
if (e instanceof EntityNotFoundException enfe) {
|
||||
if (enfe.getType().equals(DistributionSet.class)) {
|
||||
if (enfe.getEntityId() instanceof Collection entityId) {
|
||||
if (enfe.getInfo().get(EntityNotFoundException.TYPE).equals(DistributionSet.class.getSimpleName())) {
|
||||
if (enfe.getInfo().get(EntityNotFoundException.ENTITY_ID) instanceof Collection entityId) {
|
||||
return entityId.stream().sorted().toList().equals(missing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,8 +202,8 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThatThrownBy(() -> targetManagement.assignTag(withMissing, tag.getId()))
|
||||
.matches(e -> {
|
||||
if (e instanceof EntityNotFoundException enfe) {
|
||||
if (enfe.getType().equals(Target.class)) {
|
||||
if (enfe.getEntityId() instanceof Collection entityId) {
|
||||
if (enfe.getInfo().get(EntityNotFoundException.TYPE).equals(Target.class.getSimpleName())) {
|
||||
if (enfe.getInfo().get(EntityNotFoundException.TYPE) instanceof Collection entityId) {
|
||||
return entityId.stream().sorted().toList().equals(missing);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user