304628e2d552b5ad0065814e0f4986876b2f8e5f
[dcaegen2/services.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : DATALAKE
4  * ================================================================================
5  * Copyright 2019 China Mobile
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.datalake.feeder.domain;
22
23 import org.junit.Test;
24 import org.onap.datalake.feeder.util.TestUtil;
25
26 import static org.junit.Assert.*;
27
28 public class PortalDesignTest {
29
30     @Test
31     public void testIs() {
32
33         PortalDesign portalDesign = new PortalDesign();
34         portalDesign.setId(1);
35         portalDesign.setSubmitted(false);
36         portalDesign.setBody("jsonString");
37         portalDesign.setName("templateTest");
38         portalDesign.setTopicName(new TopicName("x"));
39         Topic topic = TestUtil.newTopic("_DL_DEFAULT_");
40         portalDesign.setTopicName(topic.getTopicName());
41         DesignType designType = new DesignType();
42         designType.setName("Kibana");
43         portalDesign.setDesignType(designType);
44         portalDesign.setNote("test");
45         assertFalse("1".equals(portalDesign.getId()));
46         assertTrue("templateTest".equals(portalDesign.getName()));
47         assertTrue("jsonString".equals(portalDesign.getBody()));
48         assertFalse("_DL_DEFAULT_".equals(portalDesign.getTopicName()));
49         assertTrue("test".equals(portalDesign.getNote()));
50         assertFalse("Kibana".equals(portalDesign.getDesignType()));
51         assertFalse("false".equals(portalDesign.getSubmitted()));
52     }
53
54 }