AddRelation

6

tests

0

failures

0

ignored

8.072s

duration

100%

successful

Tests

Test Duration Result
globalAdmin_canNotAddRelation_ifAnchorPersonDoesNotExist() 1.311s passed
globalAdmin_canNotAddRelation_ifContactDoesNotExist() 1.410s passed
globalAdmin_canNotAddRelation_ifHolderPersonDoesNotExist() 1.261s passed
globalAdmin_withoutAssumedRole_canAddRelationWithHolderAndContactData() 1.430s passed
globalAdmin_withoutAssumedRole_canAddRelationWithHolderUuidAndContactUuid() 1.378s passed
normalUser_canNotAddRelationWithNewMark() 1.282s 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:43997/api/hs/office/relations/f56ac4de-6c6e-480f-8248-de52f2282057
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 16:39:55 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "uuid": "f56ac4de-6c6e-480f-8248-de52f2282057",
    "anchor": {
        "uuid": "65eaa333-cc93-4692-86a9-84c85d992d04",
        "personType": "INCORPORATED_FIRM",
        "tradeName": "Third OHG",
        "salutation": null,
        "title": null,
        "givenName": null,
        "familyName": null
    },
    "holder": {
        "uuid": "e6f156b7-273a-4f9a-a998-681a33d5a550",
        "personType": "NATURAL_PERSON",
        "tradeName": null,
        "salutation": null,
        "title": null,
        "givenName": "Paul",
        "familyName": "Winkler"
    },
    "type": "SUBSCRIBER",
    "mark": "operations-discuss",
    "contact": {
        "uuid": "5955dcc7-056f-4b45-b87c-92b24715a13f",
        "caption": "second contact",
        "postalAddress": {
            "country": "Germany"
        },
        "emailAddresses": {
            "main": "contact-admin@secondcontact.example.com"
        },
        "phoneNumbers": {
            "phone_office": "+49 123 1234567"
        }
    }
}
toCleanup(HsOfficeRelationRealEntity, f56ac4de-6c6e-480f-8248-de52f2282057)
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
DELETING temporary HsOfficeRelationRealEntity#f56ac4de-6c6e-480f-8248-de52f2282057 deleted 1 rows
globalAdmin_withoutAssumedRole_canAddRelationWithHolderUuidAndContactUuid(): TOTAL OBJECT COUNT (after): 210 -> 210
ContextBasedTestWithCleanup.retrieveInitialTestData
normalUser_canNotAddRelationWithNewMark(): TOTAL OBJECT COUNT (initial): 210 -> 210
2026-08-10T16:39:56.766Z  WARN 371 --- [-auto-1-exec-10] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: P0001
2026-08-10T16:39:56.767Z ERROR 371 --- [-auto-1-exec-10] 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 16:39:56 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "timestamp": "2026-08-10 04:39:56",
    "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 16:39:58 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "timestamp": "2026-08-10 04:39:58",
    "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:43997/api/hs/office/relations/5e28e341-5347-449b-934b-5f352f3427a2
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 16:39:59 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "uuid": "5e28e341-5347-449b-934b-5f352f3427a2",
    "anchor": {
        "uuid": "65eaa333-cc93-4692-86a9-84c85d992d04",
        "personType": "INCORPORATED_FIRM",
        "tradeName": "Third OHG",
        "salutation": null,
        "title": null,
        "givenName": null,
        "familyName": null
    },
    "holder": {
        "uuid": "6030e69b-f402-479b-8a3d-4e206dd0b61d",
        "personType": "NATURAL_PERSON",
        "tradeName": null,
        "salutation": null,
        "title": null,
        "givenName": "Temp",
        "familyName": "Person"
    },
    "type": "SUBSCRIBER",
    "mark": "operations-discuss",
    "contact": {
        "uuid": "7edc3671-f1f9-4d30-986a-f223c4942b8f",
        "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, 5e28e341-5347-449b-934b-5f352f3427a2)
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
DELETING temporary HsOfficeRelationRealEntity#5e28e341-5347-449b-934b-5f352f3427a2 deleted 1 rows
DELETING leaked hs_office.person#6030e69b-f402-479b-8a3d-4e206dd0b61d SUCCEEDED
DELETING leaked hs_office.contact#7edc3671-f1f9-4d30-986a-f223c4942b8f 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 16:40:00 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "timestamp": "2026-08-10 04:40:00",
    "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 16:40:02 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "timestamp": "2026-08-10 04:40:02",
    "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