Merge "Convert models to JUnit 5"
[policy/models.git] / models-interactions / model-impl / rest / src / main / java / org / onap / policy / rest / HttpDeleteWithBody.java
1 /*
2  * ============LICENSE_START=======================================================
3  * rest
4  * ================================================================================
5  * Copyright (C) 2018 Amdocs. All rights reserved.
6  * Modifications Copyright (C) 2018, 2021 AT&T Intellectual Property. All rights reserved.
7  * Modifications Copyright (C) 2019 Nordix Foundation.
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.policy.rest;
24
25 import java.net.URI;
26 import lombok.NoArgsConstructor;
27 import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
28
29 /**
30  * Allows for HTTP DELETE requests to contain a body, which the HttpDelete
31  * class does not support.
32  */
33 @NoArgsConstructor
34 public class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
35     public static final String METHOD_NAME = "DELETE";
36
37     public HttpDeleteWithBody(final String uri) {
38         setURI(URI.create(uri));
39     }
40
41     public HttpDeleteWithBody(final URI uri) {
42         setURI(uri);
43     }
44
45     @Override
46     public String getMethod() {
47         return METHOD_NAME;
48     }
49 }