### Question:
WorkflowAction { protected CollectionResourceCustomization findCatalogNetworkCollection(DelegateExecution execution, org.onap.so.db.catalog.beans.Service service) { CollectionResourceCustomization networkCollection = null; int count = 0; for (CollectionResourceCustomization collectionCust : service.getCollectionResourceCustomizations()) { if (catalogDbClient.getNetworkCollectionResourceCustomizationByID( collectionCust.getModelCustomizationUUID()) != null) { networkCollection = collectionCust; count++; } } if (count == 0) { return null; } else if (count > 1) { buildAndThrowException(execution, "Found multiple Network Collections in the Service model, only one per Service is supported."); } return networkCollection; }  void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils); void setBbInputSetup(BBInputSetup bbInputSetup); void selectExecutionList(DelegateExecution execution); void handleRuntimeException(DelegateExecution execution);  }### Answer:
@Test public void findCatalogNetworkCollectionTest() { Service service = new Service(); NetworkCollectionResourceCustomization networkCustomization = new NetworkCollectionResourceCustomization(); networkCustomization.setModelCustomizationUUID("123"); service.getCollectionResourceCustomizations().add(networkCustomization); doReturn(networkCustomization).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("123"); CollectionResourceCustomization customization = workflowAction.findCatalogNetworkCollection(execution, service); assertNotNull(customization); }
@Test public void findCatalogNetworkCollectionEmptyTest() { Service service = new Service(); NetworkCollectionResourceCustomization networkCustomization = new NetworkCollectionResourceCustomization(); networkCustomization.setModelCustomizationUUID("123"); service.getCollectionResourceCustomizations().add(networkCustomization); CollectionResourceCustomization customization = workflowAction.findCatalogNetworkCollection(execution, service); assertNull(customization); }
@Test public void findCatalogNetworkCollectionMoreThanOneTest() { Service service = new Service(); NetworkCollectionResourceCustomization networkCustomization1 = new NetworkCollectionResourceCustomization(); networkCustomization1.setModelCustomizationUUID("123"); NetworkCollectionResourceCustomization networkCustomization2 = new NetworkCollectionResourceCustomization(); networkCustomization2.setModelCustomizationUUID("321"); service.getCollectionResourceCustomizations().add(networkCustomization1); service.getCollectionResourceCustomizations().add(networkCustomization2); doReturn(networkCustomization1).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("123"); doReturn(networkCustomization2).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("321"); workflowAction.findCatalogNetworkCollection(execution, service); assertEquals("Found multiple Network Collections in the Service model, only one per Service is supported.", execution.getVariable("WorkflowActionErrorMessage")); }