AddRelation

6

tests

0

failures

0

ignored

7.924s

duration

100%

successful

Tests

Test Duration Result
globalAdmin_canNotAddRelation_ifAnchorPersonDoesNotExist() 1.261s passed
globalAdmin_canNotAddRelation_ifContactDoesNotExist() 1.230s passed
globalAdmin_canNotAddRelation_ifHolderPersonDoesNotExist() 1.350s passed
globalAdmin_withoutAssumedRole_canAddRelationWithHolderAndContactData() 1.431s passed
globalAdmin_withoutAssumedRole_canAddRelationWithHolderUuidAndContactUuid() 1.328s passed
normalUser_canNotAddRelationWithNewMark() 1.324s passed

Standard output

ContextBasedTestWithCleanup.retrieveInitialTestData
globalAdmin_withoutAssumedRole_canAddRelationWithHolderUuidAndContactUuid(): TOTAL OBJECT COUNT (initial): 210 -> 210
HTTP/1.1 201 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: http://localhost:43147/api/hs/office/relations/490287e4-de7b-46c1-a2a2-471a06bf5e4e
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:35:27 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "uuid": "490287e4-de7b-46c1-a2a2-471a06bf5e4e",
    "anchor": {
        "uuid": "75a5b28b-2cc0-4752-9c54-9c0dacfea3ba",
        "personType": "INCORPORATED_FIRM",
        "tradeName": "Third OHG",
        "salutation": null,
        "title": null,
        "givenName": null,
        "familyName": null
    },
    "holder": {
        "uuid": "c98a2847-837c-42fb-bd28-881721aa8cc9",
        "personType": "NATURAL_PERSON",
        "tradeName": null,
        "salutation": null,
        "title": null,
        "givenName": "Paul",
        "familyName": "Winkler"
    },
    "type": "SUBSCRIBER",
    "mark": "operations-discuss",
    "contact": {
        "uuid": "75f45676-0177-4a33-b3a4-880abe915f98",
        "caption": "second contact",
        "postalAddress": {
            "country": "Germany"
        },
        "emailAddresses": {
            "main": "contact-admin@secondcontact.example.com"
        },
        "phoneNumbers": {
            "phone_office": "+49 123 1234567"
        }
    }
}
toCleanup(HsOfficeRelationRealEntity, 490287e4-de7b-46c1-a2a2-471a06bf5e4e)
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
DELETING temporary HsOfficeRelationRealEntity#490287e4-de7b-46c1-a2a2-471a06bf5e4e deleted 1 rows
globalAdmin_withoutAssumedRole_canAddRelationWithHolderUuidAndContactUuid(): TOTAL OBJECT COUNT (after): 210 -> 210
ContextBasedTestWithCleanup.retrieveInitialTestData
normalUser_canNotAddRelationWithNewMark(): TOTAL OBJECT COUNT (initial): 210 -> 210
2026-08-10T13:35:29.194Z  WARN 368 --- [o-auto-1-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: P0001
2026-08-10T13:35:29.194Z ERROR 368 --- [o-auto-1-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: [403] new mark "brand-new-list" for relation-type SUBSCRIBER may only be introduced by a global admin
  Where: PL/pgSQL function hs_office.relation_enforce_new_mark_by_global_admin() line 20 at RAISE
SQL statement "insert
            into hs_office.relation (uuid, version, anchoruuid, holderuuid, contactuuid, type, mark)
            values (new.uuid, new.version, new.anchoruuid, new.holderuuid, new.contactuuid, new.type, new.mark)
            returning *"
PL/pgSQL function hs_office.relation_instead_of_insert_tf() line 5 at SQL statement
HTTP/1.1 403 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:35:29 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "timestamp": "2026-08-10 01:35:29",
    "path": "",
    "statusCode": 403,
    "statusPhrase": "Forbidden",
    "message": "ERROR: [403] new mark \"brand-new-list\" for relation-type SUBSCRIBER may only be introduced by a global admin"
}
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
normalUser_canNotAddRelationWithNewMark(): TOTAL OBJECT COUNT (after): 210 -> 210
ContextBasedTestWithCleanup.retrieveInitialTestData
globalAdmin_canNotAddRelation_ifHolderPersonDoesNotExist(): TOTAL OBJECT COUNT (initial): 210 -> 210
HTTP/1.1 404 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:35:30 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "timestamp": "2026-08-10 01:35:30",
    "path": "",
    "statusCode": 404,
    "statusPhrase": "Not Found",
    "message": "ERROR: [404] cannot find Person by holderUuid: 00000000-0000-0000-0000-000000000000"
}
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
globalAdmin_canNotAddRelation_ifHolderPersonDoesNotExist(): TOTAL OBJECT COUNT (after): 210 -> 210
ContextBasedTestWithCleanup.retrieveInitialTestData
globalAdmin_withoutAssumedRole_canAddRelationWithHolderAndContactData(): TOTAL OBJECT COUNT (initial): 210 -> 210
HTTP/1.1 201 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: http://localhost:43147/api/hs/office/relations/14c8a4b8-9341-416d-a462-d7fa3af7f1b9
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:35:31 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "uuid": "14c8a4b8-9341-416d-a462-d7fa3af7f1b9",
    "anchor": {
        "uuid": "75a5b28b-2cc0-4752-9c54-9c0dacfea3ba",
        "personType": "INCORPORATED_FIRM",
        "tradeName": "Third OHG",
        "salutation": null,
        "title": null,
        "givenName": null,
        "familyName": null
    },
    "holder": {
        "uuid": "95bebc1a-c1b9-4fb7-8ae8-e3d7fe243e54",
        "personType": "NATURAL_PERSON",
        "tradeName": null,
        "salutation": null,
        "title": null,
        "givenName": "Temp",
        "familyName": "Person"
    },
    "type": "SUBSCRIBER",
    "mark": "operations-discuss",
    "contact": {
        "uuid": "9cbec91d-6a21-4626-9594-2b71e29112ac",
        "caption": "Temp Contact",
        "postalAddress": {
            "zipcode": "12345",
            "firm": "Test Contact GmbH",
            "country": "Germany",
            "city": "Dachstadt",
            "street": "Am Schieferbruch 3",
            "name": "Herr Test Contact"
        },
        "emailAddresses": {
            "main": "test@example.org"
        },
        "phoneNumbers": {
            
        }
    }
}
toCleanup(HsOfficeRelationRealEntity, 14c8a4b8-9341-416d-a462-d7fa3af7f1b9)
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
DELETING temporary HsOfficeRelationRealEntity#14c8a4b8-9341-416d-a462-d7fa3af7f1b9 deleted 1 rows
DELETING leaked hs_office.person#95bebc1a-c1b9-4fb7-8ae8-e3d7fe243e54 SUCCEEDED
DELETING leaked hs_office.contact#9cbec91d-6a21-4626-9594-2b71e29112ac SUCCEEDED
globalAdmin_withoutAssumedRole_canAddRelationWithHolderAndContactData(): TOTAL OBJECT COUNT (after): 210 -> 210
ContextBasedTestWithCleanup.retrieveInitialTestData
globalAdmin_canNotAddRelation_ifAnchorPersonDoesNotExist(): TOTAL OBJECT COUNT (initial): 210 -> 210
HTTP/1.1 404 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:35:33 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "timestamp": "2026-08-10 01:35:33",
    "path": "",
    "statusCode": 404,
    "statusPhrase": "Not Found",
    "message": "ERROR: [404] cannot find Person by anchorUuid: 00000000-0000-0000-0000-000000000000"
}
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
globalAdmin_canNotAddRelation_ifAnchorPersonDoesNotExist(): TOTAL OBJECT COUNT (after): 210 -> 210
ContextBasedTestWithCleanup.retrieveInitialTestData
globalAdmin_canNotAddRelation_ifContactDoesNotExist(): TOTAL OBJECT COUNT (initial): 210 -> 210
HTTP/1.1 404 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:35:34 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "timestamp": "2026-08-10 01:35:34",
    "path": "",
    "statusCode": 404,
    "statusPhrase": "Not Found",
    "message": "ERROR: [404] cannot find Contact by contactUuid: 00000000-0000-0000-0000-000000000000"
}
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
globalAdmin_canNotAddRelation_ifContactDoesNotExist(): TOTAL OBJECT COUNT (after): 210 -> 210