2 * Copyright © 2020 AT&T.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.ccsdk.cds.sdclistener.status;
19 import org.junit.Test;
20 import org.junit.runner.RunWith;
21 import org.onap.ccsdk.cds.sdclistener.status.ComponentStatusMessage;
22 import org.springframework.boot.test.context.SpringBootTest;
23 import org.springframework.test.context.junit4.SpringRunner;
25 import static org.junit.Assert.assertEquals;
27 @RunWith(SpringRunner.class)
28 @SpringBootTest(classes = {ComponentStatusMessageTest.class})
29 public class ComponentStatusMessageTest {
30 ComponentStatusMessage componentStatusMsg = new ComponentStatusMessage();
33 public void testComponentStatusMessage() {
34 componentStatusMsg.setComponentName("Test");
35 componentStatusMsg.setArtifactUrl("/sdc/v1/artifact");
36 componentStatusMsg.setConsumerID("cds-id-local");
37 componentStatusMsg.setDistributionID("1");
38 componentStatusMsg.setTimeStamp(01022020);
39 assertEquals(componentStatusMsg.getComponentName(), "Test");
40 assertEquals(componentStatusMsg.getArtifactURL(), "/sdc/v1/artifact");
41 assertEquals(componentStatusMsg.getConsumerID(), "cds-id-local");
42 assertEquals(componentStatusMsg.getDistributionID(), "1");
43 assertEquals(componentStatusMsg.getTimeStamp(), 01022020);
44 assertEquals(componentStatusMsg.getTimestamp(), 01022020);