Update datatypes using lombok 15/70915/6
authorshiria <shiri.amichai@amdocs.com>
Mon, 22 Oct 2018 11:19:24 +0000 (14:19 +0300)
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>
Mon, 22 Oct 2018 11:57:01 +0000 (11:57 +0000)
Issue-ID: SDC-1859
Change-Id: Ia7cfc86c9a0faa20a2fdbba08181b285ea3c7eef
Signed-off-by: shiria <shiri.amichai@amdocs.com>
openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml
openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerMetric.java
openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerMetrics.java
openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentProcessInfo.java
openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MonitoringArtifactInfo.java
openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/ComponentProcessInfoTest.java [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/MonitoringArtifactInfoTest.java [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java

index a1914ba..3fd9446 100644 (file)
             <artifactId>openecomp-sdc-versioning-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>
index ff75fba..e795a94 100644 (file)
@@ -1,25 +1,24 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2018 European Support Limited
+ *
  * 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.openecomp.core.enrichment.types;
 
+import lombok.Data;
+
+@Data
 public class CeilometerMetric {
 
   private String name;
@@ -29,43 +28,4 @@ public class CeilometerMetric {
   private String description;
 
 
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
-
-  public String getType() {
-    return type;
-  }
-
-  public void setType(String type) {
-    this.type = type;
-  }
-
-  public String getUnit() {
-    return unit;
-  }
-
-  public void setUnit(String unit) {
-    this.unit = unit;
-  }
-
-  public String getCategory() {
-    return category;
-  }
-
-  public void setCategory(String category) {
-    this.category = category;
-  }
-
-  public String getDescription() {
-    return description;
-  }
-
-  public void setDescription(String description) {
-    this.description = description;
-  }
 }
index f213986..172dbc9 100644 (file)
@@ -1,36 +1,29 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2018 European Support Limited
+ *
  * 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.openecomp.core.enrichment.types;
 
 import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
 
-public class CeilometerMetrics {
-
-  private List<CeilometerMetric> ceilometerMetricList;
 
-  public List<CeilometerMetric> getCeilometerMetricList() {
-    return ceilometerMetricList;
-  }
+@Getter
+@Setter
+public class CeilometerMetrics {
+    private List<CeilometerMetric> ceilometerMetricList;
 
-  public void setCeilometerMetricList(List<CeilometerMetric> ceilometerMetricList) {
-    this.ceilometerMetricList = ceilometerMetricList;
-  }
 }
index 5bc23da..3abbd13 100644 (file)
@@ -1,26 +1,40 @@
+/*
+ * Copyright © 2018 European Support Limited
+ *
+ * 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.
+ */
+
 package org.openecomp.core.enrichment.types;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
+import lombok.Getter;
+import lombok.Setter;
+
 
 public class ComponentProcessInfo {
-  private String name;
-  private byte[] content;
 
-  public String getName() {
-    return name;
-  }
+    @Setter
+    @Getter
+    private String name;
+
+    @Setter
+    private byte[] content;
 
-  public void setName(String name) {
-    this.name = name;
-  }
 
-  public InputStream getContent() {
-    return new ByteArrayInputStream(this.content);
-  }
+    public InputStream getContent() {
+        return new ByteArrayInputStream(this.content);
+    }
 
-  public void setContent(byte[] content) {
-    this.content = content;
-  }
 
 }
index 27a0d83..cbb8831 100644 (file)
@@ -1,45 +1,37 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2018 European Support Limited
+ *
  * 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.openecomp.core.enrichment.types;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
+import lombok.Getter;
+import lombok.Setter;
 
-public class MonitoringArtifactInfo {
-  private String name;
-  private byte[] content;
 
-  public String getName() {
-    return name;
-  }
+public class MonitoringArtifactInfo {
 
-  public void setName(String name) {
-    this.name = name;
-  }
+    @Setter
+    @Getter
+    private String name;
+    @Setter
+    private byte[] content;
 
-  public InputStream getContent() {
-    return new ByteArrayInputStream(this.content);
-  }
+    public InputStream getContent() {
+        return new ByteArrayInputStream(this.content);
+    }
 
-  public void setContent(byte[] content) {
-    this.content = content;
-  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/ComponentProcessInfoTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/ComponentProcessInfoTest.java
new file mode 100644 (file)
index 0000000..ca00400
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2018 European Support Limited
+ *
+ * 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.
+ */
+package org.openecomp.core.enrichment.types;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.commons.io.IOUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ComponentProcessInfoTest {
+
+    @Test
+    public void verifiedContentValue() throws IOException {
+        ComponentProcessInfo componentProcessInfo = new ComponentProcessInfo();
+        String contentData = "my test content data";
+        componentProcessInfo.setContent(contentData.getBytes());
+        InputStream getterContent = componentProcessInfo.getContent();
+        Assert.assertEquals(contentData, IOUtils.toString(getterContent, StandardCharsets.UTF_8.name()));
+
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/MonitoringArtifactInfoTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/MonitoringArtifactInfoTest.java
new file mode 100644 (file)
index 0000000..eb6983f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2018 European Support Limited
+ *
+ * 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.
+ */
+package org.openecomp.core.enrichment.types;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.commons.io.IOUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class MonitoringArtifactInfoTest {
+
+    @Test
+    public void verifiedContentValue() throws IOException {
+        MonitoringArtifactInfo monitoringArtifactInfo = new MonitoringArtifactInfo();
+        String contentData = "my test content data";
+        monitoringArtifactInfo.setContent(contentData.getBytes());
+        InputStream getterContent = monitoringArtifactInfo.getContent();
+        Assert.assertEquals(contentData, IOUtils.toString(getterContent, StandardCharsets.UTF_8.name()));
+
+    }
+}
\ No newline at end of file
index 832f959..c916944 100644 (file)
@@ -1,25 +1,22 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2018 European Support Limited
+ *
  * 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.openecomp.core.translator.datatypes;
 
+import lombok.Data;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 
@@ -27,33 +24,10 @@ import java.util.List;
 import java.util.Map;
 
 
+@Data
 public class TranslatorOutput {
   private Map<String, List<ErrorMessage>> errorMessages;
   private ToscaServiceModel toscaServiceModel;
   private ToscaServiceModel nonUnifiedToscaServiceModel;
 
-  public Map<String, List<ErrorMessage>> getErrorMessages() {
-    return errorMessages;
-  }
-
-  public void setErrorMessages(Map<String, List<ErrorMessage>> errorMessages) {
-    this.errorMessages = errorMessages;
-  }
-
-  public ToscaServiceModel getToscaServiceModel() {
-    return toscaServiceModel;
-  }
-
-  public void setToscaServiceModel(ToscaServiceModel toscaServiceModel) {
-    this.toscaServiceModel = toscaServiceModel;
-  }
-
-  public ToscaServiceModel getNonUnifiedToscaServiceModel() {
-    return nonUnifiedToscaServiceModel;
-  }
-
-  public void setNonUnifiedToscaServiceModel(
-      ToscaServiceModel nonUnifiedToscaServiceModel) {
-    this.nonUnifiedToscaServiceModel = nonUnifiedToscaServiceModel;
-  }
 }