Compare commits

...

2 Commits

Author SHA1 Message Date
Michael Hoennig
53ffe9e738 fix SwaggerUI issue with duplicate method name 2024-01-02 13:03:15 +01:00
Michael Hoennig
f1e977c905 add documentation for re-running tests from command line 2024-01-02 11:21:22 +01:00
3 changed files with 22 additions and 7 deletions

View File

@ -421,6 +421,21 @@ Underneath of rbac and hs, the structure is business oriented, NOT technical / l
Some of these rules are checked with *ArchUnit* unit tests. Some of these rules are checked with *ArchUnit* unit tests.
### Run Tests from Command Line
Run all tests which have not yet been passed with the current source code:
```shell
gw test
```
Force running all tests:
```shell
gw cleanTest test
```
### Spotless Code Formatting ### Spotless Code Formatting
Code formatting for Java is checked via *spotless*. Code formatting for Java is checked via *spotless*.
@ -579,7 +594,7 @@ Summary for Debian-based Linux systems:
sudo apt-get -y install podman sudo apt-get -y install podman
``` ```
2Then start it like this: Then start it like this:
```shell ```shell
systemctl --user enable --now podman.socket systemctl --user enable --now podman.socket
@ -610,7 +625,7 @@ we need to register a shutdown-hook in the test source code.
2. Now You Can Run the Tests 2. Now You Can Run the Tests
```shell ```shell
gw clean test # gw is from the .aliases file gw test # gw is from the .aliases file
``` ```
#### Use IntelliJ IDEA Run the Tests Against the Podman Daemon #### Use IntelliJ IDEA Run the Tests Against the Podman Daemon

View File

@ -51,7 +51,7 @@ public class HsOfficeRelationshipController implements HsOfficeRelationshipsApi
final HsOfficeRelationshipTypeResource relationshipType) { final HsOfficeRelationshipTypeResource relationshipType) {
context.define(currentUser, assumedRoles); context.define(currentUser, assumedRoles);
final var entities = relationshipRepo.findRelationshipRelatedToPersonUuid(personUuid, final var entities = relationshipRepo.findRelationshipRelatedToPersonUuidAndRelationshipType(personUuid,
mapper.map(relationshipType, HsOfficeRelationshipType.class)); mapper.map(relationshipType, HsOfficeRelationshipType.class));
final var resources = mapper.mapList(entities, HsOfficeRelationshipResource.class, final var resources = mapper.mapList(entities, HsOfficeRelationshipResource.class,

View File

@ -12,22 +12,22 @@ public interface HsOfficeRelationshipRepository extends Repository<HsOfficeRelat
Optional<HsOfficeRelationshipEntity> findByUuid(UUID id); Optional<HsOfficeRelationshipEntity> findByUuid(UUID id);
default List<HsOfficeRelationshipEntity> findRelationshipRelatedToPersonUuid(@NotNull UUID personUuid, HsOfficeRelationshipType relationshipType) { default List<HsOfficeRelationshipEntity> findRelationshipRelatedToPersonUuidAndRelationshipType(@NotNull UUID personUuid, HsOfficeRelationshipType relationshipType) {
return findRelationshipRelatedToPersonUuid(personUuid, relationshipType.toString()); return findRelationshipRelatedToPersonUuidAndRelationshipTypeString(personUuid, relationshipType.toString());
} }
@Query(value = """ @Query(value = """
SELECT p.* FROM hs_office_relationship_rv AS p SELECT p.* FROM hs_office_relationship_rv AS p
WHERE p.relAnchorUuid = :personUuid OR p.relHolderUuid = :personUuid WHERE p.relAnchorUuid = :personUuid OR p.relHolderUuid = :personUuid
""", nativeQuery = true) """, nativeQuery = true)
List<HsOfficeRelationshipEntity> findRelationshipRelatedToPersonUuid2(@NotNull UUID personUuid); List<HsOfficeRelationshipEntity> findRelationshipRelatedToPersonUuid(@NotNull UUID personUuid);
@Query(value = """ @Query(value = """
SELECT p.* FROM hs_office_relationship_rv AS p SELECT p.* FROM hs_office_relationship_rv AS p
WHERE (:relationshipType IS NULL OR p.relType = cast(:relationshipType AS HsOfficeRelationshipType)) WHERE (:relationshipType IS NULL OR p.relType = cast(:relationshipType AS HsOfficeRelationshipType))
AND ( p.relAnchorUuid = :personUuid OR p.relHolderUuid = :personUuid) AND ( p.relAnchorUuid = :personUuid OR p.relHolderUuid = :personUuid)
""", nativeQuery = true) """, nativeQuery = true)
List<HsOfficeRelationshipEntity> findRelationshipRelatedToPersonUuid(@NotNull UUID personUuid, String relationshipType); List<HsOfficeRelationshipEntity> findRelationshipRelatedToPersonUuidAndRelationshipTypeString(@NotNull UUID personUuid, String relationshipType);
HsOfficeRelationshipEntity save(final HsOfficeRelationshipEntity entity); HsOfficeRelationshipEntity save(final HsOfficeRelationshipEntity entity);