diff options
5 files changed, 44 insertions, 17 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/roles/RoleProviderTest.java b/vid-app-common/src/test/java/org/onap/vid/roles/RoleProviderTest.java index 5f4fc7861..ed7f82a45 100644 --- a/vid-app-common/src/test/java/org/onap/vid/roles/RoleProviderTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/roles/RoleProviderTest.java @@ -201,9 +201,7 @@ public class RoleProviderTest { private String owningEntityId() { - // while translateOwningEntityNameToOwningEntityId does nothing, no translation happens. - // this will be changed later. - return SAMPLE_SUBSCRIBER; + return EXISTING_OWNING_ENTITY_ID; } private void setSubscribers() { diff --git a/vid-automation/conf/users b/vid-automation/conf/users index 648b661a5..8f38018b8 100644 --- a/vid-automation/conf/users +++ b/vid-automation/conf/users @@ -14,7 +14,7 @@ "password": "1" }, "roles": [ - "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "WayneHolland___LOB", "Melissa___LOB", "aaa1___LOB", "SILVIA ROBBINS___TYLER SILVIA", "SILVIA ROBBINS___DARREN MCGEE", "CAR_2020_ER___DARREN MCGEE", "CAR_2020_ER___MSO-dev-service-type", "CAR_2020_ER___TYLER SILVIA","READ___LOGS___PERMITTED","Emanuel___mySubType", "global-customer-id___service-instance-type" ], "subscriberNames": ["SILVIA ROBBINS", "CAR_2020_ER", "Emanuel", "global-customer-id"], @@ -27,7 +27,7 @@ "password": "3" }, "roles": [ - "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "WayneHolland___LOB", "Melissa___LOB", "aaa1___LOB", "Emanuel___Emanuel" ], "subscriberNames": ["Emanuel"], @@ -40,7 +40,7 @@ "password": "667" }, "roles": [ - "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "WayneHolland___LOB", "Melissa___LOB", "aaa1___LOB", "CRAIG/ROBERTS___AIM Transport" ], "subscriberNames": ["CRAIG/ROBERTS"], @@ -53,7 +53,7 @@ "password": "4" }, "roles": [ - "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "WayneHolland___LOB", "Melissa___LOB", "aaa1___LOB", "Emanuel___vWINIFRED", "Emanuel___vRichardson" ], "subscriberNames": ["Emanuel"], @@ -66,7 +66,7 @@ "password": "822" }, "roles": [ - "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "WayneHolland___LOB", "Melissa___LOB", "aaa1___LOB", "JULIO ERICKSON___Emanuel", "JULIO ERICKSON___vRichardson" @@ -81,7 +81,7 @@ "password": "312" }, "roles": [ - "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "WayneHolland___LOB", "Melissa___LOB", "aaa1___LOB", "Emanuel___vRichardson" ], "subscriberNames": ["Emanuel"], @@ -94,7 +94,7 @@ "password": "312" }, "roles": [ - "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "WayneHolland___LOB", "Melissa___LOB", "aaa1___LOB", "Emanuel___vWINIFRED___test-hvf6-09" ], "subscriberNames": ["Emanuel"], diff --git a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java index 54300c22a..958ba87d1 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java @@ -907,7 +907,7 @@ public class AaiApiTest extends BaseApiAaiTest { public void searchServiceInstancesBySubscriber_serviceInstanceOfAnotherSubscriber_authIsFollowingFeatureToggle() { String craigRobertsSubscriberId = "31739f3e-526b-11e6-beb8-9e71128cae77"; String aServiceOwningEntityId = "f160c875-ddd1-4ef5-84d8-d098784daa3a"; - String currentUserAuthorizedOwningEntityId = "SILVIA ROBBINS"; // this will need to change with translateOwningEntityNameToOwningEntityId + String currentUserAuthorizedOwningEntityId = "d61e6f2d-12fa-4cc2-91df-7c244011d6fc"; SimulatorApi.registerExpectation(GET_SUBSCRIBERS_FOR_CUSTOMER_CRAIG_ROBERTS, ImmutableMap.of(aServiceOwningEntityId, currentUserAuthorizedOwningEntityId), CLEAR_THEN_SET); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts index 8905d4110..3499377ac 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts @@ -80,6 +80,7 @@ describe('Shared Tree Service', () => { let service: SharedTreeService; let _objectToInstanceTreeService: ObjectToInstanceTreeService; let store: NgRedux<AppState>; + beforeAll(done => (async () => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule, NgReduxTestingModule, SdcUiComponentsModule], @@ -392,6 +393,34 @@ describe('Shared Tree Service', () => { expect(isDiffCustomizationUuidResponse).toEqual(expected); }); + each([ + [false, true, true, false], + [true, true, true, true], + [true, true, false, true], + [true, false, true, true], + [true, false, false, false], + ]). + test('when flag is %s the UpdatedLatestVersion is %s and Vfmodule CustomizationUuid Differ is %s isShouldShowButtonGenericMustToBeCalled should return %s', ( + flag: boolean, + isThereAnUpdatedLatestVersion: boolean, + isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer: boolean, + isShouldShowButtonGenericMustToBeCalled: boolean + ) => { + let node = <any> {}; + let serviceModelId : string = '08c5fa17-769a-4231-bd92-aed4b0ed086d'; + jest.spyOn(store, 'getState').mockReturnValue(<any>{ + global: { + "flags": { + "FLAG_FLASH_REPLACE_VF_MODULE": flag, + }, + } + }); + spyOn(service, 'isThereAnUpdatedLatestVersion').and.returnValue(isThereAnUpdatedLatestVersion); + spyOn(service, 'isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer').and.returnValue(isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer); + + expect(service.isVfMoudleCouldBeUpgraded(node, serviceModelId)).toEqual(isShouldShowButtonGenericMustToBeCalled); + }); + }); function getStore() { diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts index 9e7a0211e..de859e4ea 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts @@ -216,13 +216,13 @@ export class SharedTreeService { * should return true if customer can upgrade a VFM * ****************************************************/ shouldShowUpgrade(node, serviceModelId): boolean { - if (FeatureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE, this._store) && - (this.isThereAnUpdatedLatestVersion(serviceModelId)) || this.isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer(node, serviceModelId)) { - return this.shouldShowButtonGeneric(node, VNFMethods.UPGRADE, serviceModelId); - } - else { - return false + return (this.isVfMoudleCouldBeUpgraded(node, serviceModelId)) + && this.shouldShowButtonGeneric(node, VNFMethods.UPGRADE, serviceModelId) ; } + + isVfMoudleCouldBeUpgraded(node, serviceModelId): boolean{ + return (FeatureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE, this._store) && + ((this.isThereAnUpdatedLatestVersion(serviceModelId)) || this.isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer(node, serviceModelId))) } |