2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2022-2025 OpenInfra Foundation Europe. All rights reserved.
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 jakarta.ws.rs.DELETE;
24 import jakarta.ws.rs.POST;
25 import jakarta.ws.rs.Path;
26 import jakarta.ws.rs.Produces;
27 import jakarta.ws.rs.core.Response;
28 import org.onap.policy.clamp.acm.participant.policy.concepts.DeploymentGroups;
29 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
30 import org.springframework.web.bind.annotation.RequestBody;
33 * Mock rest endpoints for api and pap servers.
36 @Produces("application/json")
37 public class MockRestEndpoint {
40 * Dummy endpoint for create policy types.
42 * @param body tosca service template
43 * @return the response
45 @Path("policy/api/v1/policytypes")
47 public Response createPolicyType(@RequestBody ToscaServiceTemplate body) {
48 return Response.status(200).build();
52 * Dummy endpoint for create policies.
54 * @param body tosca service template
55 * @return the response
57 @Path("policy/api/v1/policies")
59 public Response createPolicy(@RequestBody ToscaServiceTemplate body) {
60 return Response.status(200).build();
64 * Dummy endpoint for delete policy types.
66 * @return the response
68 @Path("policy/api/v1/policytypes/{policyTypeId}/versions/{versionId}")
70 public Response deletePolicyType() {
71 return Response.status(200).build();
75 * Dummy endpoint for delete policy.
77 * @return the response
79 @Path("policy/api/v1/policies/{policyId}/versions/{versionId}")
81 public Response deletePolicy() {
82 return Response.status(200).build();
86 * Dummy endpoint for deploy/undeploy policy in pap.
88 * @param body pdp deployment group
89 * @return the response
91 @Path("policy/pap/v1/pdps/deployments/batch")
93 public Response handlePolicyDeployOrUndeploy(@RequestBody DeploymentGroups body) {
94 return Response.status(200).build();