- move client-related code into a dedicated clients module inside the common pom
to allow better exclusion of unwanted dependencies
- in the future all clients should have their own module to selectively include them
Issue-ID: SO-4215
Change-Id: Iee70dccf5c520d6b09c6de875b1f752e8a256d8f
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
<properties>
</properties>
<dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot</artifactId>
+ </dependency>
<dependency>
<groupId>org.onap.so</groupId>
<artifactId>logger</artifactId>
}
public HttpClient newXmlClient(URL host, ONAPComponentsList targetEntity) {
- return new HttpClient(host, MediaType.APPLICATION_XML, targetEntity);
+ return new HttpClient(host, MediaType.APPLICATION_XML, MediaType.APPLICATION_XML, targetEntity);
}
public HttpClient newTextXmlClient(URL host, ONAPComponentsList targetEntity) {
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.so</groupId>
+ <artifactId>common</artifactId>
+ <version>1.16.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.onap.so.common</groupId>
+ <artifactId>clients</artifactId>
+
+ <properties>
+ <ccsdk.version>1.1.5</ccsdk.version>
+ <protobuf.version>3.22.2</protobuf.version>
+ <grpc.netty.version>4.1.30.Final</grpc.netty.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>clients-base</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-proto</artifactId>
+ <version>${ccsdk.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-boot-starter</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-protobuf</artifactId>
+ <version>${grpc.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-netty</artifactId>
+ <version>${grpc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ <version>${kafka-clients.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>uk.org.webcompere</groupId>
+ <artifactId>system-stubs-jupiter</artifactId>
+ <version>1.1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-testing</artifactId>
+ <version>${grpc.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
* 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.
URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post");
HttpClient client = httpClientFactory.newJsonClient(url, ONAPComponents.BPMN);
- client.addAdditionalHeader("Accept", "application/json");
+ // client.addAdditionalHeader("Accept", "application/json");
client.addAdditionalHeader("id", null);
client.post("{}");
HttpClient client = httpClientFactory.newJsonClient(url, ONAPComponents.BPMN);
client.addBasicAuthHeader("", "12345");
- client.addAdditionalHeader("Accept", "application/json");
client.post("{}");
URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post");
HttpClient client = httpClientFactory.newXmlClient(url, ONAPComponents.BPMN);
- client.accept = "application/xml";
client.addAdditionalHeader("id", null);
client.post("{}");
URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post");
HttpClient client = httpClientFactory.newTextXmlClient(url, ONAPComponents.BPMN);
- client.addAdditionalHeader("Accept", "text/xml");
+ // client.addAdditionalHeader("Accept", "text/xml");
client.addAdditionalHeader("id", null);
client.post("{}");
HttpClient client = httpClientFactory.newTextXmlClient(url, ONAPComponents.BPMN);
client.addBasicAuthHeader("", "12345");
- client.addAdditionalHeader("Accept", "text/xml");
+ // client.addAdditionalHeader("Accept", "text/xml");
client.post("{}");
<name>common</name>
<description>MSO Common classes:- Logger</description>
<properties>
- <protobuf.version>3.22.2</protobuf.version>
- <grpc.netty.version>4.1.30.Final</grpc.netty.version>
- <ccsdk.version>1.1.5</ccsdk.version>
<tomcat-catalina-version>9.0.105</tomcat-catalina-version>
<logback.version>1.2.13</logback.version>
</properties>
<dependencies>
<dependency>
<groupId>org.onap.so</groupId>
- <artifactId>logger</artifactId>
+ <artifactId>utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onap.so</groupId>
- <artifactId>clients-base</artifactId>
+ <artifactId>logger</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so.common</groupId>
+ <artifactId>clients</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
- <dependency>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- <version>2.5.0</version>
- </dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-starter-sleuth</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-sleuth-zipkin</artifactId>
+ </dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
</dependency>
- <!-- CDS dependencies -->
- <dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
- <artifactId>blueprint-proto</artifactId>
- <version>${ccsdk.version}</version>
- <exclusions>
- <exclusion>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-boot-starter</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.kafka</groupId>
- <artifactId>kafka-clients</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- protobuf dependencies -->
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- <version>${protobuf.version}</version>
- </dependency>
-
- <!-- gRPC dependencies -->
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-protobuf</artifactId>
- <version>${grpc.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-netty</artifactId>
- <version>${grpc.version}</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-testing</artifactId>
- <version>${grpc.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-external-task-client</artifactId>
- </dependency>
<dependency>
<groupId>org.onap.appc.client</groupId>
<artifactId>client-lib</artifactId>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-core</artifactId>
- <version>2.3.0</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.3.0</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-sleuth</artifactId>
- </dependency>
- <!-- kafka dependency -->
- <dependency>
- <groupId>org.apache.kafka</groupId>
- <artifactId>kafka-clients</artifactId>
- <version>${kafka-clients.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.org.webcompere</groupId>
- <artifactId>system-stubs-jupiter</artifactId>
- <version>1.1.0</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<systemPropertyVariables>
<so.log.level>DEBUG</so.log.level>
</systemPropertyVariables>
- <rerunFailingTestsCount>2</rerunFailingTestsCount>
<parallel>suites</parallel>
<useUnlimitedThreads>false</useUnlimitedThreads>
<threadCount>1</threadCount>
* 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.
test("org.onap.so.appc.orchestrator.service.beans");
test("org.onap.so.client.policy.entities");
test("org.onap.so.client.grm.beans");
- test("org.onap.so.client.sdno.beans");
test("org.onap.so.entity");
test("org.onap.so.serviceinstancebeans");
}
* 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.
* ============LICENSE_END=========================================================
*/
-package org.onap.so.utils;
+package org.onap.so.logging;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.spi.ILoggingEvent;
org:
onap:
so:
- cloud-owner: my-custom-owner
\ No newline at end of file
+ cloud-owner: my-custom-owner
+spring:
+ sleuth:
+ enabled: false
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.
</encoder>
</appender>
- <appender name="test" class="org.onap.so.utils.TestAppender" />
+ <appender name="test" class="org.onap.so.logging.TestAppender" />
<logger name="com.att.ecomp.audit" level="info" additivity="false">
<appender-ref ref="STDOUT" />
<logger name="org.reflections" level="ERROR" additivity="false">
<appender-ref ref="STDOUT" />
</logger>
-
+
<logger name="org.reflections" level="ERROR" />
<root level="WARN">
</root>
-</configuration>
\ No newline at end of file
+</configuration>
<artifactId>common</artifactId>
<packaging>pom</packaging>
<modules>
+ <module>utils</module>
<module>logger</module>
<module>clients-base</module>
+ <module>clients</module>
<module>common</module>
</modules>
</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.so</groupId>
+ <artifactId>common</artifactId>
+ <version>1.16.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>utils</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>logger</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path</artifactId>
+ <version>2.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-core</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-external-task-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
<version>2.4</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-sleuth</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-sleuth-zipkin</artifactId>
- </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. 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.so.client.sdno;
+
+import org.junit.Test;
+import com.openpojo.reflection.PojoClass;
+import com.openpojo.reflection.PojoClassFilter;
+import com.openpojo.reflection.filters.FilterEnum;
+import com.openpojo.reflection.filters.FilterNonConcrete;
+import com.openpojo.reflection.filters.FilterPackageInfo;
+import com.openpojo.validation.Validator;
+import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.rule.impl.GetterMustExistRule;
+import com.openpojo.validation.rule.impl.NoNestedClassRule;
+import com.openpojo.validation.rule.impl.NoPublicFieldsExceptStaticFinalRule;
+import com.openpojo.validation.rule.impl.NoStaticExceptFinalRule;
+import com.openpojo.validation.rule.impl.SerializableMustHaveSerialVersionUIDRule;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
+
+
+public class BeansTest {
+
+ private PojoClassFilter filterTestClasses = new FilterTestClasses();
+
+ private PojoClassFilter enumFilter = new FilterEnum();
+
+
+
+ @Test
+ public void pojoStructure() {
+ test("org.onap.so.client.sdno.beans");
+ }
+
+ private void test(String pojoPackage) {
+ Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new NoNestedClassRule())
+ .with(new NoStaticExceptFinalRule()).with(new SerializableMustHaveSerialVersionUIDRule())
+ .with(new NoPublicFieldsExceptStaticFinalRule()).with(new SetterTester()).with(new GetterTester())
+ .build();
+
+
+ validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses, enumFilter,
+ new FilterNonConcrete());
+ }
+
+ private static class FilterTestClasses implements PojoClassFilter {
+ public boolean include(PojoClass pojoClass) {
+ return !pojoClass.getSourcePath().contains("/test-classes/");
+ }
+ }
+}