diff options
author | zhaoyh6 <zhaoyh6@asiainfo.com> | 2022-03-01 14:58:07 +0800 |
---|---|---|
committer | Ajith Sreekumar <ajith.sreekumar@bell.ca> | 2022-03-10 15:09:32 +0000 |
commit | 448c221502fac54c52e088caca56b9aa45797ef7 (patch) | |
tree | d7504ea0c277055042b91cd2cb61b820e5c8eecd /models-interactions/model-simulators | |
parent | bf4c0bd31b6045a25ecf24b9508bc256cb724b20 (diff) |
Closed loop operation guarantee for ccvpn
Issue-ID: REQ-1074
Signed-off-by: zhaoyh6 <zhaoyh6@asiainfo.com>
Change-Id: Ib2c60a1e5ebd1fda5e04e75c265e863733caa278
Diffstat (limited to 'models-interactions/model-simulators')
3 files changed, 42 insertions, 0 deletions
diff --git a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java index 3d2187895..948529fab 100644 --- a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java +++ b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java @@ -5,6 +5,7 @@ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 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. @@ -134,6 +135,14 @@ public class SoSimulatorJaxRs { return ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.3gpp.success.json"); } + @PUT + @Path("/infra/serviceIntent/v1/modify") + @Consumes(MediaType.APPLICATION_JSON) + @Produces("application/json") + public String soPostModifyCll(@ApiParam(required = true) SoRequest3gpp request) { + return ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.cll.success.json"); + } + private String makeStarted() { var requestId = UUID.randomUUID().toString(); diff --git a/models-interactions/model-simulators/src/main/resources/org/onap/policy/simulators/so/so.cll.success.json b/models-interactions/model-simulators/src/main/resources/org/onap/policy/simulators/so/so.cll.success.json new file mode 100644 index 000000000..98f045503 --- /dev/null +++ b/models-interactions/model-simulators/src/main/resources/org/onap/policy/simulators/so/so.cll.success.json @@ -0,0 +1,5 @@ +{ + "jobId": "db245365e79c47ed88fcd60caa8f6549", + "status": "In progress", + "statusDescription": {} +} 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..31b76270c 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; @@ -248,6 +250,32 @@ public class SoSimulatorTest { return request; } + @Test + public void testModifyCll() { + SoSimulatorJaxRs.setRequirePolling(false); + String request = Serialization.gsonPretty.toJson(this.createCllRequest()); + Pair<Integer, String> 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<String, Object>()); + + return request; + } + private String extractUri(String response) { final String prefix = "\"requestId\": \""; |