1 /*******************************************************************************
2 * ============LICENSE_START==================================================
4 * * ===========================================================================
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * * ===========================================================================
7 * * Licensed under the Apache License, Version 2.0 (the "License");
8 * * you may not use this file except in compliance with the License.
9 * * You may obtain a copy of the License at
11 * * http://www.apache.org/licenses/LICENSE-2.0
13 * * Unless required by applicable law or agreed to in writing, software
14 * * distributed under the License is distributed on an "AS IS" BASIS,
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * * See the License for the specific language governing permissions and
17 * * limitations under the License.
18 * * ============LICENSE_END====================================================
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 ******************************************************************************/
24 package datarouter.provisioning;
26 import static org.junit.Assert.fail;
28 import java.io.IOException;
30 import javax.servlet.http.HttpServletResponse;
32 import org.apache.http.HttpEntity;
33 import org.apache.http.HttpResponse;
34 import org.apache.http.client.methods.HttpPut;
35 import org.apache.http.util.EntityUtils;
36 import org.junit.Test;
37 import org.onap.dmaap.datarouter.provisioning.FeedServlet;
39 public class IntegrationTestDrFeedsPut extends IntegrationTestBase {
41 public void testNotAllowed() {
42 String url = props.getProperty("test.host") + "/";
43 HttpPut put = new HttpPut(url);
45 put.addHeader(FeedServlet.BEHALF_HEADER, "JUnit");
47 HttpResponse response = httpclient.execute(put);
48 ckResponse(response, HttpServletResponse.SC_METHOD_NOT_ALLOWED);
50 HttpEntity entity = response.getEntity();
51 EntityUtils.consume(entity);
52 } catch (IOException e) {
55 put.releaseConnection();