1
0

add updatePackage (description) using JsonNullableModule and HTTP-to-DB test with RestAssured

This commit is contained in:
Michael Hoennig
2022-08-09 17:51:50 +02:00
parent 0486dc3fae
commit 0e4602aac6
15 changed files with 437 additions and 58 deletions

View File

@ -182,6 +182,40 @@ paths:
type: array
items:
$ref: '#/components/schemas/Package'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
/api/packages/{packageUUID}:
patch:
tags:
- packages
operationId: updatePackage
parameters:
- $ref: '#/components/parameters/currentUser'
- $ref: '#/components/parameters/assumedRoles'
- name: packageUUID
in: path
required: true
schema:
type: string
format: uuid
requestBody:
content:
'application/json':
schema:
$ref: '#/components/schemas/PackageUpdate'
responses:
"200":
description: OK
content:
'application/json':
schema:
$ref: '#/components/schemas/Package'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
components:
@ -290,10 +324,20 @@ components:
uuid:
type: string
format: uuid
name:
type: string
customer:
$ref: '#/components/schemas/Customer'
name:
type: string
description:
type: string
maxLength: 80
PackageUpdate:
type: object
properties:
description:
type: string
maxLength: 80
nullable: true
Error:
type: object
properties:

View File

@ -12,3 +12,6 @@ map:
- type: array => java.util.List
- type: string:uuid => java.util.UUID
paths:
/api/packages/{packageUUID}:
null: org.openapitools.jackson.nullable.JsonNullable

View File

@ -188,6 +188,7 @@ drop view if exists package_rv;
create or replace view package_rv as
select target.*
from package as target
where target.uuid in (select queryAccessibleObjectUuidsOfSubjectIds('view', 'package', currentSubjectIds()));
where target.uuid in (select queryAccessibleObjectUuidsOfSubjectIds('view', 'package', currentSubjectIds()))
order by target.name;
grant all privileges on package_rv to restricted;
--//

View File

@ -37,8 +37,8 @@ create or replace procedure createPackageTestData(
set local hsadminng.currentTask to currentTask;
insert
into package (name, customerUuid)
values (pacName, cust.uuid)
into package (customerUuid, name, description)
values (cust.uuid, pacName, 'Here can add your own description of package ' || pacName || '.')
returning * into pac;
call grantRoleToUser(

View File

@ -7,7 +7,8 @@
create table if not exists package
(
uuid uuid unique references RbacObject (uuid),
name character varying(5),
customerUuid uuid references customer (uuid)
customerUuid uuid references customer (uuid),
name varchar(5),
description varchar(80)
);
--//