X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=rapp-manager-application%2Fsrc%2Ftest%2Fjava%2Fcom%2Foransc%2Frappmanager%2Fservice%2FRappServiceTest.java;h=7bf8adb353d706afaadd5a06fcb63bb2e4b66431;hb=2a90215e5995c56a75880a6e281f85d7caf6cd99;hp=d9be9b7dd196db82e538cd520a04fdb6d061abe0;hpb=8accdd881808e0086e46a7e4388fa43c7997aa72;p=nonrtric%2Fplt%2Frappmanager.git diff --git a/rapp-manager-application/src/test/java/com/oransc/rappmanager/service/RappServiceTest.java b/rapp-manager-application/src/test/java/com/oransc/rappmanager/service/RappServiceTest.java index d9be9b7..7bf8adb 100755 --- a/rapp-manager-application/src/test/java/com/oransc/rappmanager/service/RappServiceTest.java +++ b/rapp-manager-application/src/test/java/com/oransc/rappmanager/service/RappServiceTest.java @@ -1,3 +1,22 @@ +/*- + * ============LICENSE_START====================================================================== + * Copyright (C) 2023 Nordix Foundation. All rights reserved. + * Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved. + * =============================================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END======================================================================== + */ + package com.oransc.rappmanager.service; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -174,18 +193,6 @@ class RappServiceTest { assertEquals(HttpStatus.BAD_GATEWAY, rappService.deployRappInstance(rapp, rappInstance).getStatusCode()); } - @Test - void testDeployRappInstanceDmeFailure() { - Rapp rapp = Rapp.builder().rappId(UUID.randomUUID()).name("").packageName(validRappFile) - .packageLocation(validCsarFileLocation).state(RappState.PRIMED).build(); - RappInstance rappInstance = new RappInstance(); - rappInstanceStateMachine.onboardRappInstance(rappInstance.getRappInstanceId()); - when(acmDeployer.deployRappInstance(any(), any())).thenReturn(true); - when(smeDeployer.deployRappInstance(any(), any())).thenReturn(true); - when(dmeDeployer.deployRappInstance(any(), any())).thenReturn(false); - assertEquals(HttpStatus.BAD_GATEWAY, rappService.deployRappInstance(rapp, rappInstance).getStatusCode()); - } - @Test void testDeployRappInstanceFailureWithState() { Rapp rapp = Rapp.builder().rappId(UUID.randomUUID()).name("").packageName(validRappFile) @@ -228,19 +235,6 @@ class RappServiceTest { assertEquals(HttpStatus.BAD_GATEWAY, rappService.undeployRappInstance(rapp, rappInstance).getStatusCode()); } - @Test - void testUndeployRappInstanceDmeFailure() { - Rapp rapp = Rapp.builder().rappId(UUID.randomUUID()).name("").packageName(validRappFile) - .packageLocation(validCsarFileLocation).state(RappState.PRIMED).build(); - RappInstance rappInstance = new RappInstance(); - rappInstance.setState(RappInstanceState.DEPLOYED); - rappInstanceStateMachine.onboardRappInstance(rappInstance.getRappInstanceId()); - when(acmDeployer.undeployRappInstance(any(), any())).thenReturn(true); - when(smeDeployer.undeployRappInstance(any(), any())).thenReturn(true); - when(dmeDeployer.undeployRappInstance(any(), any())).thenReturn(false); - assertEquals(HttpStatus.BAD_GATEWAY, rappService.undeployRappInstance(rapp, rappInstance).getStatusCode()); - } - @Test void testUndeployRappInstanceInvalidStateFailure() { Rapp rapp = Rapp.builder().rappId(UUID.randomUUID()).name("").packageName(validRappFile)