From a87acaacec791669429e0def1ec1f0e461c91f9e Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 15 Nov 2024 09:55:01 +0100 Subject: [PATCH] Streamline controller method naming leaned to HTTP verbs --- .../coopassets/HsOfficeCoopAssetsTransactionController.java | 6 +++--- .../coopshares/HsOfficeCoopSharesTransactionController.java | 2 +- .../hs-office/hs-office-coopassets-with-uuid.yaml | 2 +- .../api-definition/hs-office/hs-office-coopassets.yaml | 4 ++-- .../hs-office/hs-office-coopshares-with-uuid.yaml | 2 +- ...OfficeCoopAssetsTransactionControllerAcceptanceTest.java | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java index 4ab26f49..3fec8397 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java @@ -36,7 +36,7 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse @Override @Transactional(readOnly = true) - public ResponseEntity> listCoopAssets( + public ResponseEntity> getListOfCoopAssets( final String currentSubject, final String assumedRoles, final UUID membershipUuid, @@ -55,7 +55,7 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse @Override @Transactional - public ResponseEntity addCoopAssetsTransaction( + public ResponseEntity postNewCoopAssetTransaction( final String currentSubject, final String assumedRoles, final HsOfficeCoopAssetsTransactionInsertResource requestBody) { @@ -77,7 +77,7 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse @Override @Transactional(readOnly = true) - public ResponseEntity getCoopAssetTransactionByUuid( + public ResponseEntity geSingleCoopAssetTransactionByUuid( final String currentSubject, final String assumedRoles, final UUID assetTransactionUuid) { context.define(currentSubject, assumedRoles); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionController.java index c8a9241e..8cd3d9a9 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionController.java @@ -80,7 +80,7 @@ public class HsOfficeCoopSharesTransactionController implements HsOfficeCoopShar @Override @Transactional(readOnly = true) - public ResponseEntity geSingletCoopShareTransactionByUuid( + public ResponseEntity geSingleCoopShareTransactionByUuid( final String currentSubject, final String assumedRoles, final UUID shareTransactionUuid) { context.define(currentSubject, assumedRoles); diff --git a/src/main/resources/api-definition/hs-office/hs-office-coopassets-with-uuid.yaml b/src/main/resources/api-definition/hs-office/hs-office-coopassets-with-uuid.yaml index 51d51c2c..7d1fb349 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-coopassets-with-uuid.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-coopassets-with-uuid.yaml @@ -2,7 +2,7 @@ get: tags: - hs-office-coopAssets description: 'Fetch a single asset transaction by its uuid, if visible for the current subject.' - operationId: getCoopAssetTransactionByUuid + operationId: geSingleCoopAssetTransactionByUuid parameters: - $ref: 'auth.yaml#/components/parameters/currentSubject' - $ref: 'auth.yaml#/components/parameters/assumedRoles' diff --git a/src/main/resources/api-definition/hs-office/hs-office-coopassets.yaml b/src/main/resources/api-definition/hs-office/hs-office-coopassets.yaml index bff3e1d5..55880595 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-coopassets.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-coopassets.yaml @@ -3,7 +3,7 @@ get: description: Returns the list of (optionally filtered) cooperative asset transactions which are visible to the current subject or any of it's assumed roles. tags: - hs-office-coopAssets - operationId: listCoopAssets + operationId: getListOfCoopAssets parameters: - $ref: 'auth.yaml#/components/parameters/currentSubject' - $ref: 'auth.yaml#/components/parameters/assumedRoles' @@ -46,7 +46,7 @@ post: summary: Adds a new cooperative asset transaction. tags: - hs-office-coopAssets - operationId: addCoopAssetsTransaction + operationId: postNewCoopAssetTransaction parameters: - $ref: 'auth.yaml#/components/parameters/currentSubject' - $ref: 'auth.yaml#/components/parameters/assumedRoles' diff --git a/src/main/resources/api-definition/hs-office/hs-office-coopshares-with-uuid.yaml b/src/main/resources/api-definition/hs-office/hs-office-coopshares-with-uuid.yaml index 87d3da86..4265f3ca 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-coopshares-with-uuid.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-coopshares-with-uuid.yaml @@ -2,7 +2,7 @@ get: tags: - hs-office-coopShares description: 'Fetch a single share transaction by its uuid, if visible for the current subject.' - operationId: geSingletCoopShareTransactionByUuid + operationId: geSingleCoopShareTransactionByUuid parameters: - $ref: 'auth.yaml#/components/parameters/currentSubject' - $ref: 'auth.yaml#/components/parameters/assumedRoles' diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java index 0caafbab..d5785ffa 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java @@ -55,7 +55,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased EntityManager em; @Nested - class ListCoopAssetsTransactions { + class GetListOfCoopAssetsTransactions { @Test void globalAdmin_canViewAllCoopAssetsTransactions() { @@ -166,10 +166,10 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased } @Nested - class AddCoopAssetsTransaction { + class PostNewCoopAssetTransaction { @Test - void globalAdmin_canAddCoopAssetsTransaction() { + void globalAdmin_canPostNewCoopAssetTransaction() { context.define("superuser-alex@hostsharing.net"); final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000101);