aboutsummaryrefslogtreecommitdiffstats
path: root/datafile-commons
diff options
context:
space:
mode:
Diffstat (limited to 'datafile-commons')
-rw-r--r--datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/ConsumerDmaapModelForUnitTest.java58
-rw-r--r--datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java8
2 files changed, 5 insertions, 61 deletions
diff --git a/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/ConsumerDmaapModelForUnitTest.java b/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/ConsumerDmaapModelForUnitTest.java
deleted file mode 100644
index 62e6b1bf..00000000
--- a/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/ConsumerDmaapModelForUnitTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * ============LICENSE_START======================================================================
- * Copyright (C) 2018 NOKIA Intellectual Property, 2018 Nordix Foundation. All rights reserved.
- * ===============================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- * ============LICENSE_END========================================================================
- */
-
-package org.onap.dcaegen2.collectors.datafile.model;
-
-public class ConsumerDmaapModelForUnitTest implements ConsumerDmaapModel {
- private final String name;
- private final String location;
- private final String compression;
- private final String fileFormatType;
- private final String fileFormatVersion;
-
- public ConsumerDmaapModelForUnitTest() {
- this.name = "A20161224.1030-1045.bin.gz";
- this.location = "target/A20161224.1030-1045.bin.gz";
- this.compression = "gzip";
- this.fileFormatType = "org.3GPP.32.435#measCollec";
- this.fileFormatVersion = "V10";
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getLocation() {
- return location;
- }
-
- @Override
- public String getCompression() {
- return compression;
- }
-
- @Override
- public String getFileFormatType() {
- return fileFormatType;
- }
-
- @Override
- public String getFileFormatVersion() {
- return fileFormatVersion;
- }
-}
diff --git a/datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java b/datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java
index f27e3b6c..7ec6f50e 100644
--- a/datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java
+++ b/datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java
@@ -21,11 +21,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
class CommonFunctionsTest {
- private ConsumerDmaapModel model = new ConsumerDmaapModelForUnitTest();
+ private ConsumerDmaapModel model = ImmutableConsumerDmaapModel.builder().name("A20161224.1030-1045.bin.gz")
+ .location("target/A20161224.1030-1045.bin.gz").compression("gzip")
+ .fileFormatType("org.3GPP.32.435#measCollec").fileFormatVersion("V10").build();
private static final String EXPECTED_RESULT =
"{\"name\":\"A20161224.1030-1045.bin.gz\",\"location\":\"target/A20161224.1030-1045.bin.gz\","
- + "\"compression\":\"gzip\",\"fileFormatType\":\"org.3GPP.32.435#measCollec\","
- + "\"fileFormatVersion\":\"V10\"}";
+ + "\"compression\":\"gzip\",\"fileFormatType\":\"org.3GPP.32.435#measCollec\","
+ + "\"fileFormatVersion\":\"V10\"}";
@Test
void createJsonBody_shouldReturnJsonInString() {