X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fa1-controller-client%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fa1controller%2Fclient%2Ftest%2FA1ControllerClientTest.java;fp=dashboard%2Fa1-controller-client%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fa1controller%2Fclient%2Ftest%2FA1ControllerClientTest.java;h=0000000000000000000000000000000000000000;hb=8831a02bce715562f3cacce1691bf4d9d3af206b;hp=cbafba42cd59ccb3c8b2442f140c955d8dc57999;hpb=01cf1b466e7eebf51789b83fbab5139880c20107;p=nonrtric.git diff --git a/dashboard/a1-controller-client/src/test/java/org/oransc/ric/portal/dashboard/a1controller/client/test/A1ControllerClientTest.java b/dashboard/a1-controller-client/src/test/java/org/oransc/ric/portal/dashboard/a1controller/client/test/A1ControllerClientTest.java deleted file mode 100644 index cbafba42..00000000 --- a/dashboard/a1-controller-client/src/test/java/org/oransc/ric/portal/dashboard/a1controller/client/test/A1ControllerClientTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 Nordix Foundation - * %% - * 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 org.oransc.ric.portal.dashboard.a1controller.client.test; - -import java.lang.invoke.MethodHandles; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.oransc.ric.a1controller.client.api.A1ControllerApi; -import org.oransc.ric.a1controller.client.invoker.ApiClient; -import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidPISchema; -import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidPISchemaInput; -import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidSchema; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.client.RestClientException; - -/** - * Demonstrates use of the generated A1 controller client. - * - * The tests fail because no server is available. - */ -public class A1ControllerClientTest { - - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - @Test - public void demo() { - ApiClient apiClient = new ApiClient(); - apiClient.setBasePath("http://localhost:30099/"); - A1ControllerApi a1Api = new A1ControllerApi(apiClient); - try { - Object o = a1Api.a1ControllerGetPolicyInstance(new InputNRRidPTidPIidSchema()); - logger.info( - "getPolicy answered code {}, content {} ", apiClient.getStatusCode().toString(), o.toString()); - Assertions.assertTrue(apiClient.getStatusCode().is2xxSuccessful()); - } catch (RestClientException e) { - logger.error("getPolicy failed: {}", e.toString()); - } - try { - String policy = "{}"; - InputNRRidPTidPIidPISchema body = new InputNRRidPTidPIidPISchema(); - InputNRRidPTidPIidPISchemaInput input = new InputNRRidPTidPIidPISchemaInput(); - input.setNearRtRicId("1"); - input.setPolicyTypeId(1); - input.setPolicyInstanceId("1"); - input.setPolicyInstance("{}"); - body.setInput(input); - a1Api.a1ControllerCreatePolicyInstance(body); - logger.info("putPolicy answered: {}", apiClient.getStatusCode().toString()); - Assertions.assertTrue(apiClient.getStatusCode().is2xxSuccessful()); - } catch (RestClientException e) { - logger.error("getPolicy failed: {}", e.toString()); - } - } -}