2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2022 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.clamp.acm.participant.policy.main.utils;
23 import javax.ws.rs.DELETE;
24 import javax.ws.rs.POST;
25 import javax.ws.rs.Path;
26 import javax.ws.rs.Produces;
27 import javax.ws.rs.core.Response;
28 import org.onap.policy.models.pdp.concepts.DeploymentGroups;
29 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
30 import org.springframework.web.bind.annotation.RequestBody;
34 * Mock rest endpoints for api and pap servers.
37 @Produces("application/json")
38 public class MockRestEndpoint {
41 * Dummy endpoint for create policy types.
43 * @param body tosca service template
44 * @return the response
46 @Path("policy/api/v1/policytypes")
48 public Response createPolicyType(@RequestBody ToscaServiceTemplate body) {
49 return Response.status(200).build();
53 * Dummy endpoint for create policies.
55 * @param body tosca service template
56 * @return the response
58 @Path("policy/api/v1/policies")
60 public Response createPolicy(@RequestBody ToscaServiceTemplate body) {
61 return Response.status(200).build();
65 * Dummy endpoint for delete policy types.
67 * @return the response
69 @Path("policy/api/v1/policytypes/{policyTypeId}/versions/{versionId}")
71 public Response deletePolicyType() {
72 return Response.status(200).build();
76 * Dummy endpoint for delete policy.
78 * @return the response
80 @Path("policy/api/v1/policies/{policyId}/versions/{versionId}")
82 public Response deletePolicy() {
83 return Response.status(200).build();
87 * Dummy endpoint for deploy/undeploy policy in pap.
89 * @param body pdp deployment group
90 * @return the response
92 @Path("policy/pap/v1/pdps/deployments/batch")
94 public Response handlePolicyDeployOrUndeploy(@RequestBody DeploymentGroups body) {
95 return Response.status(200).build();