|
|
Sorry, something went wrong.
|
Hey @Fabian-K , thanks for your contribution! Could you please:
|
Sorry, something went wrong.
|
@Kehrlann Thanks for picking this up! I´ve rebased and added an integration test. I did however not run the integration test because I don´t have a cf landscape available with admin permissions. I only used a local build of the client and was able to do some testing there. |
Sorry, something went wrong.
|
@Fabian-K Thanks! Will run the integration tests and let you know. Please apply the formatting rules on the integration test project as well: ./mvnw spotless:apply -Pintegration-test |
Sorry, something went wrong.
|
Done, thank you! |
Sorry, something went wrong.
There was a problem hiding this comment.
One issue. Will run integration tests once I have an env provisioned.
Sorry, something went wrong.
|
@Fabian-K this is in backlog, but we're in the middle of infrastructure migration, so I don't have an env at the moment. I'll merge this when I can test it. |
Sorry, something went wrong.
|
@Fabian-K I finally got a chance to run the integration test. Unfortunately, it does not work, and fails with: RolesTest.listIncludeUser expectation "expectNext(test-user-id-hcfmp)" failed (expected: onNext(test-user-id-hcfmp); actual: onError(org.cloudfoundry.reactor.util.JsonParsingException: Cannot construct instance of `org.cloudfoundry.client.v3.users.UserResource`, problem: Cannot build UserResource, some of required attributes are not set [username, origin]
at [Source: (byte[])"{"pagination":{"total_results":1,"total_pages":1,"first":{"href":"https://api.sys.tas.7f364f3c.shepherd.tanzu.broadcom.net/v3/roles?guids=3887a197-009f-466b-8a93-7b932bb4e3b9\u0026include=user\u0026order_by=%2Bcreated_at\u0026page=1\u0026per_page=50"},"last":{"href":"https://api.sys.tas.7f364f3c.shepherd.tanzu.broadcom.net/v3/roles?guids=3887a197-009f-466b-8a93-7b932bb4e3b9\u0026include=user\u0026order_by=%2Bcreated_at\u0026page=1\u0026per_page=50"},"next":null,"previous":null},"resources":[{"gu"[truncated 1024 bytes]; line: 1, column: 1521] (through reference chain: org.cloudfoundry.client.v3.roles.ListRolesResponse$Json["included"]->org.cloudfoundry.client.v3.roles.RoleIncluded$Json["users"]->java.util.ArrayList[0])))
That's because the response to the roles request looks like this: {
"pagination": {
"total_results": 1,
"total_pages": 1,
"first": {
"href": "https://api.sys.tas.7f364f3c.shepherd.tanzu.broadcom.net/v3/roles?guids=d5cae192-3d32-4be2-b786-4bf07600d06b&include=user&order_by=%2Bcreated_at&page=1&per_page=50"
},
"last": {
"href": "https://api.sys.tas.7f364f3c.shepherd.tanzu.broadcom.net/v3/roles?guids=d5cae192-3d32-4be2-b786-4bf07600d06b&include=user&order_by=%2Bcreated_at&page=1&per_page=50"
},
"next": null,
"previous": null
},
"resources": [
{
"guid": "d5cae192-3d32-4be2-b786-4bf07600d06b",
"created_at": "2025-07-10T08:41:01Z",
"updated_at": "2025-07-10T08:41:01Z",
"type": "organization_user",
"relationships": {
"user": {
"data": {
"guid": "test-user-id-b99k7"
}
},
"organization": {
"data": {
"guid": "56e6381d-7219-451d-ab4b-10576d49a0ac"
}
},
"space": {
"data": null
}
},
"links": {
"self": {
"href": "https://api.sys.tas.7f364f3c.shepherd.tanzu.broadcom.net/v3/roles/d5cae192-3d32-4be2-b786-4bf07600d06b"
},
"user": {
"href": "https://api.sys.tas.7f364f3c.shepherd.tanzu.broadcom.net/v3/users/test-user-id-b99k7"
},
"organization": {
"href": "https://api.sys.tas.7f364f3c.shepherd.tanzu.broadcom.net/v3/organizations/56e6381d-7219-451d-ab4b-10576d49a0ac"
}
}
}
],
"included": {
"users": [
{
"guid": "test-user-id-b99k7",
"created_at": "2025-07-10T08:41:01Z",
"updated_at": "2025-07-10T08:41:01Z",
"username": null,
"presentation_name": "test-user-id-b99k7",
"origin": null,
"metadata": {
"labels": {},
"annotations": {}
},
"links": {
"self": {
"href": "https://api.sys.tas.7f364f3c.shepherd.tanzu.broadcom.net/v3/users/test-user-id-b99k7"
}
}
}
]
}
}
And, AFAICT, this is not a valid User resource because it's missing username & origin. You need to update the test to insert an actual user, and use that user's ID in the requestCreateOrganizationRelationship. |
Sorry, something went wrong.
Hi,
this PR adds support for the "include" query parameter to the list roles request API v3. This is my first contribution to this repository. Please let me know in case I missed something :)
Thanks,
Fabian
fixes #1204