Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-api-handlers / mso-api-handler-infra / src / test / java / org / onap / so / apihandlerinfra / tenantisolation / dmaap / SDCDmaapClientTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.apihandlerinfra.tenantisolation.dmaap;
22
23 import static org.junit.Assert.assertEquals;
24 import java.io.IOException;
25 import java.text.ParseException;
26 import org.junit.Test;
27 import org.onap.so.apihandlerinfra.BaseTest;
28 import org.onap.so.apihandlerinfra.tenantisolation.dmaap.CreateEcompOperationEnvironmentBean;
29 import com.fasterxml.jackson.databind.ObjectMapper;
30
31 public class SDCDmaapClientTest extends BaseTest {
32
33     private final String fileLocation = "src/test/resources/org/onap/so/client/asdc/create-ecompoe/";
34
35     private static final String operationalEnvironmentId = "28122015552391";
36     private static final String operationalEnvironmentName = "Operational Environment Name";
37     private static final String operationalEnvironmentType = "ECOMP";
38     private static final String tenantContext = "TEST";
39     private static final String workloadContext = "ECOMP_E2E-IST";
40     private static final String action = "Create";
41
42
43
44     @Test
45     public void verifyasdcCreateoeRequest() throws IOException, ParseException {
46
47         ObjectMapper mapper = new ObjectMapper();
48
49         String expected =
50                 "{\"operationalEnvironmentId\":\"28122015552391\",\"operationalEnvironmentName\":\"Operational Environment Name\",\"operationalEnvironmentType\":\"ECOMP\",\"tenantContext\":\"TEST\",\"workloadContext\":\"ECOMP_E2E-IST\",\"action\":\"Create\"}";
51
52
53         CreateEcompOperationEnvironmentBean cBean = new CreateEcompOperationEnvironmentBean();
54         cBean.setOperationalEnvironmentId(operationalEnvironmentId);
55         cBean.setoperationalEnvironmentName(operationalEnvironmentName);
56         cBean.setoperationalEnvironmentType(operationalEnvironmentType);
57         cBean.settenantContext(tenantContext);
58         cBean.setworkloadContext(workloadContext);
59         cBean.setaction(action);
60
61         String actual = mapper.writeValueAsString(cBean);
62
63         assertEquals("payloads are equal", expected, actual);
64     }
65
66
67
68 }