X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-simulators%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fsimulators%2FSoSimulatorTest.java;h=129f2841b1a5f30d48786b43e9d96c620f865193;hb=938005505883cf7a636a8840e20e3dc8a0ad9176;hp=7654e005394d084d6d270874fef49aa35fb52bd7;hpb=0690ef13433cb30d3d6c475990a818a714f0538d;p=policy%2Fmodels.git diff --git a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java index 7654e0053..129f2841b 100644 --- a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java +++ b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java @@ -5,6 +5,7 @@ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019-2020 Nordix Foundation. * Modifications Copyright (C) 2020 Wipro Limited. + * Modifications Copyright (C) 2022 CTC, Inc. and others. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,6 +43,7 @@ import org.onap.policy.so.SoRelatedInstance; import org.onap.policy.so.SoRelatedInstanceListElement; import org.onap.policy.so.SoRequest; import org.onap.policy.so.SoRequest3gpp; +import org.onap.policy.so.SoRequestCll; import org.onap.policy.so.SoRequestDetails; import org.onap.policy.so.SoRequestInfo; import org.onap.policy.so.SoRequestParameters; @@ -55,7 +57,8 @@ public class SoSimulatorTest { @BeforeClass public static void setUpSimulator() { try { - Util.buildSoSim(); + var testServer = Util.buildSoSim(); + assertNotNull(testServer); } catch (final Exception e) { fail(e.getMessage()); } @@ -248,6 +251,32 @@ public class SoSimulatorTest { return request; } + @Test + public void testModifyCll() { + SoSimulatorJaxRs.setRequirePolling(false); + String request = Serialization.gsonPretty.toJson(this.createCllRequest()); + Pair httpDetails = new RestManager().put( + "http://localhost:6667/infra/serviceIntent/v1/modify", + "username", + "password", new HashMap<>(), "application/json", request); + assertNotNull(httpDetails); + assertEquals(200, httpDetails.getLeft().intValue()); + assertThat(httpDetails.getRight()).contains("jobId").contains("status"); + } + + private SoRequestCll createCllRequest() { + SoRequestCll request = new SoRequestCll(); + + request.setName("cloud-leased-line-101"); + request.setServiceInstanceId("cll-instance-01"); + request.setGlobalSubscriberId("IBNCustomer"); + request.setSubscriptionServiceType("ibn"); + request.setServiceType("CLL"); + request.setAdditionalProperties(new HashMap()); + + return request; + } + private String extractUri(String response) { final String prefix = "\"requestId\": \"";