2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 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.openecomp.sdc.be.resources.data;
23 import org.junit.Test;
25 import java.nio.ByteBuffer;
26 import java.util.Date;
29 public class ComponentCacheDataTest {
31 private ComponentCacheData createTestSubject() {
32 return new ComponentCacheData();
36 public void testCtor() throws Exception {
37 new ComponentCacheData("mock");
38 new ComponentCacheData("mock", new byte[0]);
39 new ComponentCacheData("mock", new byte[0], new Date(), "mock", true, true);
43 public void testGetDataAsArray() throws Exception {
44 ComponentCacheData testSubject;
48 testSubject = createTestSubject();
49 result = testSubject.getDataAsArray();
54 public void testSetDataAsArray() throws Exception {
55 ComponentCacheData testSubject;
56 byte[] data = new byte[] { ' ' };
59 testSubject = createTestSubject();
61 testSubject.setDataAsArray(data);
64 testSubject = createTestSubject();
65 data = new byte[] { ' ' };
66 testSubject.setDataAsArray(data);
71 public void testGetData() throws Exception {
72 ComponentCacheData testSubject ;
74 testSubject = createTestSubject();
76 testSubject.getData();
80 public void testSetData() throws Exception {
81 ComponentCacheData testSubject ;
83 testSubject = createTestSubject();
85 ByteBuffer data = ByteBuffer.allocate(0);
86 testSubject.setData(data);
90 public void testGetId() throws Exception {
91 ComponentCacheData testSubject;
95 testSubject = createTestSubject();
96 result = testSubject.getId();
101 public void testSetId() throws Exception {
102 ComponentCacheData testSubject;
106 testSubject = createTestSubject();
107 testSubject.setId(id);
112 public void testGetModificationTime() throws Exception {
113 ComponentCacheData testSubject;
117 testSubject = createTestSubject();
118 result = testSubject.getModificationTime();
123 public void testSetModificationTime() throws Exception {
124 ComponentCacheData testSubject;
125 Date modificationTime = null;
128 testSubject = createTestSubject();
129 testSubject.setModificationTime(modificationTime);
134 public void testGetType() throws Exception {
135 ComponentCacheData testSubject;
139 testSubject = createTestSubject();
140 result = testSubject.getType();
145 public void testSetType() throws Exception {
146 ComponentCacheData testSubject;
150 testSubject = createTestSubject();
151 testSubject.setType(type);
156 public void testGetIsDirty() throws Exception {
157 ComponentCacheData testSubject;
161 testSubject = createTestSubject();
162 result = testSubject.getIsDirty();
167 public void testSetIsDirty() throws Exception {
168 ComponentCacheData testSubject;
169 boolean isDirty = false;
172 testSubject = createTestSubject();
173 testSubject.setIsDirty(isDirty);
178 public void testGetIsZipped() throws Exception {
179 ComponentCacheData testSubject;
183 testSubject = createTestSubject();
184 result = testSubject.getIsZipped();
189 public void testSetIsZipped() throws Exception {
190 ComponentCacheData testSubject;
191 boolean isZipped = false;
194 testSubject = createTestSubject();
195 testSubject.setIsZipped(isZipped);