fix HsHostingAssetRepository.findAllByCriteriaImpl query #69
No reviewers
Labels
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hostsharing/hs.hsadmin.ng#69
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix-find-hosting-assets-query"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -16,4 +16,1 @@
@Query("""
SELECT asset FROM HsHostingAssetEntity asset
WHERE (:projectUuid IS NULL OR asset.bookingItem.project.uuid = :projectUuid)
This JPQL query did only work for hosting-assets which have a directly-assigned booking-item because "left" was missing for the joins.
When I tried to run a test with EMAIL_ALIAS, it returned no records at all.
@ -7,13 +7,13 @@ get:
parameters:
- $ref: 'auth.yaml#/components/parameters/currentUser'
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
- name: debitorUuid
This was a remnant from times before we had a project between debitor and asset. project makes more sense and the actual query was only implemented for project anyway.
@ -89,22 +89,10 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType("application/json")
.body("", lenientlyEquals("""
[
{
because of the mismatch of debitor+project,
?projectUuid=" + givenProject.getUuid()
was ignored and too many rows were returned, now, where this is fixed, only the rows for "D-1000111 default project" get returned@ -206,3 +207,4 @@
.findAny().orElseThrow().getUuid();
// when
context("superuser-alex@hostsharing.net", "hs_hosting_asset#vm1012:AGENT");
the test name says "normalUser ..." but the superuser context without assumed role was still open, now assuming a normal users role
3021048c87
to278467efac
@ -412,4 +413,2 @@
.containsExactlyInAnyOrder(serverNames);
}
void allTheseServersAreReturned(final List<HsHostingAssetEntity> actualResult, final String... serverNames) {
it's always better to test for exact returns then just for "contains", amended all calls, thus this methods is not needed anymore