2 * ============LICENSE_START=======================================================
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
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=========================================================
21 package org.onap.so.apihandlerinfra.tenantisolation.dmaap;
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;
31 public class SDCDmaapClientTest extends BaseTest {
33 private final String fileLocation = "src/test/resources/org/onap/so/client/asdc/create-ecompoe/";
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";
45 public void verifyasdcCreateoeRequest() throws IOException, ParseException {
47 ObjectMapper mapper = new ObjectMapper();
50 "{\"operationalEnvironmentId\":\"28122015552391\",\"operationalEnvironmentName\":\"Operational Environment Name\",\"operationalEnvironmentType\":\"ECOMP\",\"tenantContext\":\"TEST\",\"workloadContext\":\"ECOMP_E2E-IST\",\"action\":\"Create\"}";
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);
61 String actual = mapper.writeValueAsString(cBean);
63 assertEquals("payloads are equal", expected, actual);