when signaling the frontend about templates check the correct flag FLAG_2004_CREATE_A... 72/102672/1
authorAmichai Hemli <amichai.hemli@intl.att.com>
Sun, 1 Mar 2020 14:36:19 +0000 (16:36 +0200)
committerAmichai Hemli <amichai.hemli@intl.att.com>
Sun, 1 Mar 2020 15:14:07 +0000 (17:14 +0200)
Issue-ID: VID-739
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Change-Id: Iaed25f1932eed675310c8d0003d415352991d19e

vid-app-common/src/main/java/org/onap/vid/services/InstantiationTemplatesService.java
vid-app-common/src/test/java/org/onap/vid/services/InstantiationTemplatesServiceTest.java

index 17520ee..8837798 100644 (file)
@@ -76,7 +76,7 @@ public class InstantiationTemplatesService {
     }
 
     public Collection<Service> setOnEachServiceIsTemplateExists(Collection<Service> services){
-        if (!featureManager.isActive(Features.FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE)){
+        if (!featureManager.isActive(Features.FLAG_2004_INSTANTIATION_TEMPLATES_POPUP)){
             return unsetTemplateExistsToAllServices(services);
 
         }
index de9fc2b..48895fe 100644 (file)
@@ -140,7 +140,7 @@ public class InstantiationTemplatesServiceTest {
 
     @Test
     public void setTemplatesExistance_givenCollection__flagIsActive_thenSameCollectionReturnedWithTemplateExistsProperty(){
-        when(featureManager.isActive(Features.FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE)).thenReturn(true);
+        when(featureManager.isActive(Features.FLAG_2004_INSTANTIATION_TEMPLATES_POPUP)).thenReturn(true);
         when(asyncInstantiationRepository.getAllTemplatesServiceModelIds()).thenReturn(ImmutableSet.of("1", "2"));
         Collection<Service> actualCollection = instantiationTemplatesService.setOnEachServiceIsTemplateExists(createGivenCollection());
         assertThat(actualCollection, containsInAnyOrder(
@@ -151,7 +151,7 @@ public class InstantiationTemplatesServiceTest {
 
     @Test
     public void setTemplatesExistance_givenCollection_flagIsNotActive_thenTemplatesExistNotAdded(){
-        when(featureManager.isActive(Features.FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE)).thenReturn(false);
+        when(featureManager.isActive(Features.FLAG_2004_INSTANTIATION_TEMPLATES_POPUP)).thenReturn(false);
         Collection<Service> actualCollection = instantiationTemplatesService.setOnEachServiceIsTemplateExists(createGivenCollection());
         assertThat("was " + actualCollection, actualCollection, containsInAnyOrder(
             allOf(hasProperty("uuid", is("1")), hasProperty("isInstantiationTemplateExists", is(false))),