Improve naming conventions for RestOutputPublicCmHandleProperties 56/141256/1
authorleventecsanyi <levente.csanyi@est.tech>
Thu, 12 Jun 2025 09:36:35 +0000 (11:36 +0200)
committerleventecsanyi <levente.csanyi@est.tech>
Thu, 12 Jun 2025 09:36:40 +0000 (11:36 +0200)
  - renamed methods and classes

Issue-Id: CPS-2834
Change-Id: Ia54dd98ddcfdef0a1c1b9152e1a76c790fbda8b8
Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
13 files changed:
cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java
cps-ncmp-rest/docs/openapi/ncmp.yml
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/NetworkCmProxyInventoryFacadeImpl.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryService.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceImpl.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImplSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceSpec.groovy
docs/api/swagger/ncmp/openapi.yaml

index 309b4ed..4318f44 100644 (file)
@@ -159,7 +159,7 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi {
     }
 
     @Override
-    public ResponseEntity<RestOutputPublicCmHandleProperties> getCmHandlePublicPropertiesByCmHandleId(
+    public ResponseEntity<RestOutputPublicCmHandleProperties> getPublicCmHandlePropertiesByCmHandleId(
             final String cmHandle) {
         return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
     }
index bd26750..77541ff 100755 (executable)
@@ -383,7 +383,7 @@ getCmHandlePropertiesById:
     tags:
       - network-cm-proxy
     summary: Get CM handle properties
-    operationId: getCmHandlePublicPropertiesByCmHandleId
+    operationId: getPublicCmHandlePropertiesByCmHandleId
     parameters:
       - $ref: 'components.yaml#/components/parameters/cmHandleReferenceInPath'
     responses:
index 2b0ea31..258b884 100644 (file)
@@ -314,13 +314,13 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
      * @return cm handle properties
      */
     @Override
-    public ResponseEntity<RestOutputPublicCmHandleProperties> getCmHandlePublicPropertiesByCmHandleId(
+    public ResponseEntity<RestOutputPublicCmHandleProperties> getPublicCmHandlePropertiesByCmHandleId(
             final String cmHandleReference) {
-        final List<Map<String, String>> cmHandlePublicProperties = new ArrayList<>(1);
-        cmHandlePublicProperties.add(networkCmProxyInventoryFacade.getCmHandlePublicProperties(cmHandleReference));
+        final List<Map<String, String>> publicCmHandleProperties = new ArrayList<>(1);
+        publicCmHandleProperties.add(networkCmProxyInventoryFacade.getPublicCmHandleProperties(cmHandleReference));
         final RestOutputPublicCmHandleProperties restOutputPublicCmHandleProperties =
                 new RestOutputPublicCmHandleProperties();
-        restOutputPublicCmHandleProperties.setPublicCmHandleProperties(cmHandlePublicProperties);
+        restOutputPublicCmHandleProperties.setPublicCmHandleProperties(publicCmHandleProperties);
         return ResponseEntity.ok(restOutputPublicCmHandleProperties);
     }
 
index 32fcd53..ce7ef1f 100644 (file)
@@ -35,7 +35,6 @@ import org.onap.cps.events.EventsProducer
 import org.onap.cps.ncmp.impl.NetworkCmProxyInventoryFacadeImpl
 import org.onap.cps.ncmp.api.inventory.models.CompositeState
 import org.onap.cps.ncmp.api.inventory.models.NcmpServiceCmHandle
-import org.onap.cps.ncmp.api.inventory.models.TrustLevel
 import org.onap.cps.ncmp.impl.data.NetworkCmProxyFacade
 import org.onap.cps.ncmp.api.inventory.DataStoreSyncState
 import org.onap.cps.ncmp.api.inventory.models.CmHandleState
@@ -312,7 +311,7 @@ class NetworkCmProxyControllerSpec extends Specification {
         and: 'some cm handle public properties'
             def publicProperties = ['public prop': 'some public property']
         and: 'the service method is invoked with the cm handle id returning the cm handle public properties'
-            1 * mockNetworkCmProxyInventoryFacade.getCmHandlePublicProperties('some-cm-handle-reference') >> publicProperties
+            1 * mockNetworkCmProxyInventoryFacade.getPublicCmHandleProperties('some-cm-handle-reference') >> publicProperties
         when: 'the cm handle properties api is invoked'
             def response = mvc.perform(get(cmHandlePropertiesEndpoint)).andReturn().response
         then: 'the correct response is returned'
index f6d9518..615264a 100644 (file)
@@ -134,7 +134,7 @@ public interface NetworkCmProxyInventoryFacade {
      * @param cmHandleReference cm handle or alternate identifier
      * @return cm handle public properties
      */
-    Map<String, String> getCmHandlePublicProperties(final String cmHandleReference);
+    Map<String, String> getPublicCmHandleProperties(final String cmHandleReference);
 
     /**
      * Get cm handle composite state for a given cm handle id.
index a6f50d2..0c20aee 100644 (file)
@@ -161,7 +161,7 @@ public class NetworkCmProxyInventoryFacadeImpl implements NetworkCmProxyInventor
     }
 
     @Override
-    public Map<String, String> getCmHandlePublicProperties(final String cmHandleReference) {
+    public Map<String, String> getPublicCmHandleProperties(final String cmHandleReference) {
         final String cmHandleId = alternateIdMatcher.getCmHandleId(cmHandleReference);
         final YangModelCmHandle yangModelCmHandle = inventoryPersistence.getYangModelCmHandle(cmHandleId);
         return YangDataConverter.toPropertiesMap(yangModelCmHandle.getPublicProperties());
index 15aa121..c441d4d 100644 (file)
@@ -46,7 +46,7 @@ public interface CmHandleQueryService {
      * @param outputAlternateId  boolean for cm handle reference type either cmHandleId (false) or AlternateId (true)
      * @return CmHandles which have these public properties
      */
-    Collection<String> queryCmHandlePublicProperties(Map<String, String> publicPropertyQueryPairs,
+    Collection<String> queryPublicCmHandleProperties(Map<String, String> publicPropertyQueryPairs,
                                                      boolean outputAlternateId);
 
     /**
index 8d1d50e..d51a7b9 100644 (file)
@@ -75,7 +75,7 @@ public class CmHandleQueryServiceImpl implements CmHandleQueryService {
     }
 
     @Override
-    public Collection<String> queryCmHandlePublicProperties(final Map<String, String> publicPropertyQueryPairs,
+    public Collection<String> queryPublicCmHandleProperties(final Map<String, String> publicPropertyQueryPairs,
                                                             final boolean outputAlternateId) {
         return queryCmHandleAnyProperties(publicPropertyQueryPairs, PropertyType.PUBLIC, outputAlternateId);
     }
index be6ca8a..74ddc22 100644 (file)
@@ -132,7 +132,7 @@ public class ParameterizedCmHandleQueryServiceImpl implements ParameterizedCmHan
         if (publicPropertyQueryPairs.isEmpty()) {
             return NO_QUERY_TO_EXECUTE;
         }
-        return cmHandleQueryService.queryCmHandlePublicProperties(publicPropertyQueryPairs, outputAlternateId);
+        return cmHandleQueryService.queryPublicCmHandleProperties(publicPropertyQueryPairs, outputAlternateId);
     }
 
     private Collection<String> queryCmHandlesByTrustLevel(final CmHandleQueryServiceParameters
index e978121..53ee0ed 100644 (file)
@@ -73,7 +73,7 @@ class CmHandleQueryServiceImplSpec extends Specification {
         given: 'the DataNodes queried for a given cpsPath are returned from the persistence service.'
             mockResponses()
         when: 'a query on cmhandle public properties is performed with a public property pair'
-            def result = objectUnderTest.queryCmHandlePublicProperties(publicPropertyPairs, outputAlternateId)
+            def result = objectUnderTest.queryPublicCmHandleProperties(publicPropertyPairs, outputAlternateId)
         then: 'the correct cm handle data objects are returned'
             result.containsAll(expectedCmHandleReferences)
             result.size() == expectedCmHandleReferences.size()
@@ -105,7 +105,7 @@ class CmHandleQueryServiceImplSpec extends Specification {
 
     def 'Query CmHandles using empty public properties query pair.'() {
         when: 'a query on CmHandle public properties is executed using an empty map'
-            def result = objectUnderTest.queryCmHandlePublicProperties([:], false)
+            def result = objectUnderTest.queryPublicCmHandleProperties([:], false)
         then: 'no cm handles are returned'
             result.size() == 0
     }
index bb4a6ff..69654e3 100644 (file)
@@ -163,7 +163,7 @@ class NetworkCmProxyInventoryFacadeSpec extends Specification {
         and: 'the system returns this yang modelled cm handle'
             1 * mockInventoryPersistence.getYangModelCmHandle(cmHandleId) >> yangModelCmHandle
         when: 'getting cm handle public properties for a given cm handle reference from ncmp service'
-            def result = objectUnderTest.getCmHandlePublicProperties(cmHandleRef)
+            def result = objectUnderTest.getPublicCmHandleProperties(cmHandleRef)
         then: 'the result returns the correct data'
             assert result == [ 'public prop' : 'some public prop' ]
         where: 'following cm handle reference is used'
index 82753ef..4735cf3 100644 (file)
@@ -189,7 +189,7 @@ class ParameterizedCmHandleQueryServiceSpec extends Specification {
             def conditionProperties = createConditionProperties(conditionName, [['some-key': 'some-value']])
             cmHandleQueryParameters.setCmHandleQueryParameters([conditionProperties])
         and: 'the inventoryPersistence returns different CmHandleIds'
-            partiallyMockedCmHandleQueries.queryCmHandlePublicProperties(*_) >> cmHandlesWithMatchingPublicProperties
+            partiallyMockedCmHandleQueries.queryPublicCmHandleProperties(*_) >> cmHandlesWithMatchingPublicProperties
             partiallyMockedCmHandleQueries.queryCmHandleAdditionalProperties(*_) >> cmHandlesWithMatchingPrivateProperties
         when: 'the query executed'
             def result = objectUnderTestWithPartiallyMockedQueries.queryCmHandleIdsForInventory(cmHandleQueryParameters, false)
index 106a536..61d4e19 100644 (file)
@@ -1083,7 +1083,7 @@ paths:
   /v1/ch/{cm-handle}/properties:
     get:
       description: Get CM handle properties by cm handle id
-      operationId: getCmHandlePublicPropertiesByCmHandleId
+      operationId: getPublicCmHandlePropertiesByCmHandleId
       parameters:
       - description: "The identifier (cmHandle or alternate) for a network function,\
           \ network element, subnetwork or any other cm object by managed Network\