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 io.swagger.annotations.ApiParam;
24 import javax.ws.rs.DELETE;
25 import javax.ws.rs.POST;
26 import javax.ws.rs.Path;
27 import javax.ws.rs.Produces;
28 import javax.ws.rs.core.Response;
29 import org.onap.policy.models.pdp.concepts.DeploymentGroups;
30 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
31 import org.springframework.web.bind.annotation.RequestBody;
35 * Mock rest endpoints for api and pap servers.
38 @Produces("application/json")
39 public class MockRestEndpoint {
42 * Dummy endpoint for create policy types.
44 * @param body tosca service template
45 * @return the response
47 @Path("policy/api/v1/policytypes")
49 public Response createPolicyType(
50 @RequestBody @ApiParam(value = "Entity body", required = true) ToscaServiceTemplate body) {
51 return Response.status(200).build();
55 * Dummy endpoint for create policies.
57 * @param body tosca service template
58 * @return the response
60 @Path("policy/api/v1/policies")
62 public Response createPolicy(
63 @RequestBody @ApiParam(value = "Entity body ", required = true) ToscaServiceTemplate body) {
64 return Response.status(200).build();
68 * Dummy endpoint for delete policy types.
70 * @return the response
72 @Path("policy/api/v1/policytypes/{policyTypeId}/versions/{versionId}")
74 public Response deletePolicyType() {
75 return Response.status(200).build();
79 * Dummy endpoint for delete policy.
81 * @return the response
83 @Path("policy/api/v1/policies/{policyId}/versions/{versionId}")
85 public Response deletePolicy() {
86 return Response.status(200).build();
90 * Dummy endpoint for deploy/undeploy policy in pap.
92 * @param body pdp deployment group
93 * @return the response
95 @Path("policy/pap/v1/pdps/deployments/batch")
97 public Response handlePolicyDeployOrUndeploy(
98 @RequestBody @ApiParam(value = "Entity body", required = true) DeploymentGroups body) {
99 return Response.status(200).build();