From e0f8ca49def5f8b67cc2bc601cc7abccbf98f1a6 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Fri, 20 Jun 2025 13:49:42 +0200 Subject: [PATCH] Reenable more tests - fix if check in VnfAdapterVfModuleObjectMapper that threw NullPointerException after RFC8040 changes (update of SDNC Client dependency) - globally remove exclusion of vintage engine to enable tests in modules that are still missing the dependency and thus don't run their tests - fix test in mso-requests-db-repositories as result of it being executed again - fix integration tests in so-bpmn-tasks and so-bpmn-infrastructure-flows that were missing pnf.kafka properties - replace deprecated RepositoryRestConfigurerAdapter class with RepositoryRestConfigurer - add lombok dependency - use constructor injection for SDNCRequestsTasks Issue-ID: SO-4174 Signed-off-by: Fiete Ostkamp Change-Id: Icaab3518738ddad38d2a19e23f0649fc4e3b6691 --- .../CatalogDbRepositoryConfiguration.java | 8 +- .../RequestDbRepositoryConfiguration.java | 4 +- .../SDNCClientPut200ResponseNotFinal.json | 2 +- .../src/test/resources/application-test.yaml | 32 +++---- .../sdnc/tasks/SDNCRequestTasks.java | 11 ++- .../vnf/mapper/VnfAdapterVfModuleObjectMapper.java | 2 +- .../sdnc/tasks/SDNCRequestTasksTest.java | 19 ++-- .../__files/SDNCClientPut200Response.json | 2 +- .../__files/SDNCClientPut200ResponseNotFinal.json | 2 +- .../src/test/resources/application-test.yaml | 27 +++--- mso-api-handlers/mso-api-handler-infra/pom.xml | 4 + .../ExposeEntityIdResourceConfiguration.java | 4 +- .../src/test/resources/application-test.yaml | 23 ++--- .../src/test/resources/schema.sql | 100 ++++++++++----------- pom.xml | 9 +- so-sdn-clients/pom.xml | 2 +- 16 files changed, 127 insertions(+), 124 deletions(-) diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDbRepositoryConfiguration.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDbRepositoryConfiguration.java index 4d8f55e220..2fbb72c16b 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDbRepositoryConfiguration.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDbRepositoryConfiguration.java @@ -7,9 +7,9 @@ * 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. @@ -25,10 +25,10 @@ import javax.persistence.metamodel.Type; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.data.rest.core.config.RepositoryRestConfiguration; -import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; @Configuration -public class CatalogDbRepositoryConfiguration extends RepositoryRestConfigurerAdapter { +public class CatalogDbRepositoryConfiguration implements RepositoryRestConfigurer { @Autowired private EntityManager entityManager; diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java index c32525a62b..4c98975821 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java @@ -5,10 +5,10 @@ import javax.persistence.EntityManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.data.rest.core.config.RepositoryRestConfiguration; -import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; @Configuration -public class RequestDbRepositoryConfiguration extends RepositoryRestConfigurerAdapter { +public class RequestDbRepositoryConfiguration implements RepositoryRestConfigurer { @Autowired private EntityManager entityManager; diff --git a/bpmn/so-bpmn-building-blocks/src/test/resources/SDNCClientPut200ResponseNotFinal.json b/bpmn/so-bpmn-building-blocks/src/test/resources/SDNCClientPut200ResponseNotFinal.json index deb4de0219..419a40cf71 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/resources/SDNCClientPut200ResponseNotFinal.json +++ b/bpmn/so-bpmn-building-blocks/src/test/resources/SDNCClientPut200ResponseNotFinal.json @@ -1,5 +1,5 @@ { - "output": { + "GENERIC-RESOURCE-API:output": { "svc-request-id": "5d24d40e-4c77-4c06-94a3-6d168c47a57c", "network-response-information": { "instance-id": "4063e0aa-af13-4872-8473-b40c94f9316b", diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/application-test.yaml b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/application-test.yaml index 7a9c4ba914..b8dfc1d6a0 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/application-test.yaml +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/application-test.yaml @@ -71,7 +71,7 @@ mso: core-pool-size: 50 max-pool-size: 50 queue-capacity: 500 - + bpmn: optimisticlockingexception: retrycount: '3' @@ -81,7 +81,7 @@ mso: #CatalogDbUtils.groovy:getResponseFromCatalogDb endpoint: http://localhost:${wiremock.server.port} spring: - endpoint: http://localhost:${wiremock.server.port} + endpoint: http://localhost:${wiremock.server.port} correlation: timeout: 60 db: @@ -107,10 +107,10 @@ mso: auth: Basic YnBlbDptc28tZGItMTUwNyE= endpoint: http://localhost:${wiremock.server.port} rollback: 'true' - sdnc: - password: 3141634BF7E070AA289CF2892C986C0B + sdnc: + password: 3141634BF7E070AA289CF2892C986C0B site-name: localDevEnv - workflow: + workflow: default: aai: cloud-region: @@ -144,7 +144,7 @@ mso: password: dmaapPassword host: http://localhost:28090 publisher: - topic: com.att.mso.asyncStatusUpdate + topic: com.att.mso.asyncStatusUpdate service-plugin: third-sp-endpoint: oof-calc-endpoint: @@ -180,10 +180,10 @@ spring: password: password driver-class-name: org.mariadb.jdbc.Driver initialize: true - jpa: + jpa: generate-ddl: false show-sql: false - hibernate: + hibernate: ddl-auto: none naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy enable-lazy-load-no-trans: true @@ -193,8 +193,10 @@ spring: username: test password: '$2a$12$Zi3AuYcZoZO/gBQyUtST2.F5N6HqcTtaNci2Et.ufsQhski56srIu' role: BPEL-Client + sleuth: + enabled: false mariaDB4j: - dataDir: + dataDir: port: 3307 databaseName: camundabpmn camunda: @@ -210,14 +212,13 @@ camunda: deployment-aware: true # PnfEventReadyDmaapClient pnf: - dmaap: - host: localhost - port: ${wiremock.server.port} - protocol: http - uriPathPrefix: events - topicName: pnfReady + kafka: + kafkaBootstrapServers: localhost:${wiremock.server.port} + pnfReadyTopicName: pnfReady + pnfUpdateTopicName: pnfUpdate consumerGroup: consumerGroup consumerId: consumerId + consumerIdUpdate: consumerIdUpdate topicListenerDelayInSeconds: 5 # CDSProcessingClient cds: @@ -225,4 +226,3 @@ cds: port: 11011 auth: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== timeout: 60 - diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java index 4dee6f12ba..8e8d972be2 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java @@ -49,10 +49,12 @@ import org.w3c.dom.Document; import org.xml.sax.InputSource; import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.PathNotFoundException; +import lombok.RequiredArgsConstructor; import net.sf.saxon.lib.NamespaceConstant; import net.sf.saxon.xpath.XPathFactoryImpl; @Component +@RequiredArgsConstructor public class SDNCRequestTasks { private static final Logger logger = LoggerFactory.getLogger(SDNCRequestTasks.class); @@ -66,11 +68,8 @@ public class SDNCRequestTasks { protected static final String IS_CALLBACK_COMPLETED = "isCallbackCompleted"; protected static final String SDNC_SUCCESS = "200"; - @Autowired - private ExceptionBuilder exceptionBuilder; - - @Autowired - private SDNCClient sdncClient; + private final ExceptionBuilder exceptionBuilder; + private final SDNCClient sdncClient; public void createCorrelationVariables(DelegateExecution execution) { SDNCRequest request = (SDNCRequest) execution.getVariable(SDNC_REQUEST); @@ -151,7 +150,7 @@ public class SDNCRequestTasks { return "Y".equals(finalMessageIndicator); } - protected String getXmlElement(final Document doc, final String exp) throws Exception { + protected static String getXmlElement(final Document doc, final String exp) throws Exception { final TransformerFactory factory = TransformerFactory.newInstance(); factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, StringUtils.EMPTY); factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, StringUtils.EMPTY); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java index 7c686bd165..9065264a9c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java @@ -191,7 +191,7 @@ public class VnfAdapterVfModuleObjectMapper { GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = vfModuleTop.getVfModuleTopology(); Map paramsMap = new HashMap<>(); - if (vfModuleTopology.getSdncGeneratedCloudResources()) { + if (Boolean.TRUE.equals(vfModuleTopology.getSdncGeneratedCloudResources())) { buildParamsMapFromVfModuleSdncResponse(paramsMap, vfModuleTopology, true); buildParamsMapFromVnfSdncResponse(paramsMap, vnfTopology, null, true); } else { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java index e435909f59..f90ca3a189 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java @@ -7,9 +7,9 @@ * 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. @@ -41,7 +41,7 @@ import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation; import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.ExceptionBuilder; @@ -49,7 +49,6 @@ import org.onap.so.client.exception.MapperException; import org.onap.so.client.sdnc.SDNCClient; import org.onap.so.client.sdnc.beans.SDNCRequest; import org.onap.so.client.sdnc.endpoint.SDNCTopology; -import org.onap.logging.filter.base.ONAPComponents; import org.w3c.dom.Document; import org.xml.sax.InputSource; import com.fasterxml.jackson.core.JsonParseException; @@ -57,13 +56,13 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; @RunWith(MockitoJUnitRunner.class) -public class SDNCRequestTasksTest extends SDNCRequestTasks { +public class SDNCRequestTasksTest { @Rule public ExpectedException expectedException = ExpectedException.none(); @InjectMocks - SDNCRequestTasks sndcRequestTasks = new SDNCRequestTasks(); + SDNCRequestTasks sndcRequestTasks; @Mock SDNCClient sdncClient; @@ -138,7 +137,7 @@ public class SDNCRequestTasksTest extends SDNCRequestTasks { new String(Files.readAllBytes(Paths.get("src/test/resources/__files/SDNC_Async_Request2.xml"))); delegateExecution.setVariable("correlationName_MESSAGE", sdncResponse); sndcRequestTasks.processCallback(delegateExecution); - assertEquals(true, delegateExecution.getVariable(IS_CALLBACK_COMPLETED)); + assertEquals(true, delegateExecution.getVariable("isCallbackCompleted")); } @Test @@ -150,9 +149,9 @@ public class SDNCRequestTasksTest extends SDNCRequestTasks { db = dbf.newDocumentBuilder(); Document doc = db.parse(new InputSource(new StringReader(sdncResponse))); - String finalMessageIndicator = getXmlElement(doc, "//*:ack-final-indicator"); - String responseCode = getXmlElement(doc, "/input/response-code"); - String responseMessage = getXmlElement(doc, "/input/response-message"); + String finalMessageIndicator = SDNCRequestTasks.getXmlElement(doc, "//*:ack-final-indicator"); + String responseCode = SDNCRequestTasks.getXmlElement(doc, "/input/response-code"); + String responseMessage = SDNCRequestTasks.getXmlElement(doc, "/input/response-message"); assertEquals("Y", finalMessageIndicator); assertEquals("200", responseCode); diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPut200Response.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPut200Response.json index 286ce4c844..2d98067480 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPut200Response.json +++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPut200Response.json @@ -1,5 +1,5 @@ { - "output": { + "GENERIC-RESOURCE-API:output": { "svc-request-id": "5d24d40e-4c77-4c06-94a3-6d168c47a57c", "network-response-information": { "instance-id": "4063e0aa-af13-4872-8473-b40c94f9316b", diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPut200ResponseNotFinal.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPut200ResponseNotFinal.json index deb4de0219..419a40cf71 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPut200ResponseNotFinal.json +++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPut200ResponseNotFinal.json @@ -1,5 +1,5 @@ { - "output": { + "GENERIC-RESOURCE-API:output": { "svc-request-id": "5d24d40e-4c77-4c06-94a3-6d168c47a57c", "network-response-information": { "instance-id": "4063e0aa-af13-4872-8473-b40c94f9316b", diff --git a/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml b/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml index d3f5696c16..baf42cd931 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml +++ b/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml @@ -31,19 +31,18 @@ log: vnfAdapterCreateV1: 'true' vnfAdapterRestV1: 'true' pnf: - dmaap: - host: hostTest - port: 1234 - protocol: http - uriPathPrefix: events - topicName: pnfReady - consumerGroup: consumerGroup - consumerId: consumerId - topicListenerDelayInSeconds: 5 + kafka: + topicListenerDelayInSeconds: 3 + kafkaBootstrapServers: localhost:9092 + pnfReadyTopicName: someTopic + pnfUpdateTopicName: someTopic2 + consumerGroup: someConsumerGroup + consumerId: someConsumerId + consumerIdUpdate: someConsumerIdUpdate mso: naming: endpoint: http://localhost:${wiremock.server.port}/web/service/v1/genNetworkElementName - auth: Basic YnBlbDptc28tZGItMTUwNyE= + auth: Basic YnBlbDptc28tZGItMTUwNyE= adapters: requestDb: auth: Basic YnBlbDptc28tZGItMTUwNyE= @@ -101,7 +100,7 @@ mso: db: endpoint: http://localhost:${wiremock.server.port}/ spring: - endpoint: http://localhost:${wiremock.server.port} + endpoint: http://localhost:${wiremock.server.port} correlation: timeout: 60 db: @@ -122,9 +121,9 @@ mso: request: db: endpoint: http://localhost:${wiremock.server.port}/ - rollback: 'true' + rollback: 'true' site-name: localDevEnv - workflow: + workflow: default: aai: cloud-region: @@ -207,6 +206,8 @@ spring: naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy enable-lazy-load-no-trans: true database-platform: org.hibernate.dialect.MySQL5InnoDBDialect + sleuth: + enabled: false sdno: health-check: dmaap: diff --git a/mso-api-handlers/mso-api-handler-infra/pom.xml b/mso-api-handlers/mso-api-handler-infra/pom.xml index 1222b22b5a..0c5e1f36a2 100644 --- a/mso-api-handlers/mso-api-handler-infra/pom.xml +++ b/mso-api-handlers/mso-api-handler-infra/pom.xml @@ -57,6 +57,10 @@ + + org.springframework.boot + spring-boot-starter-data-rest + org.springframework.boot spring-boot-starter-webflux diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java index 575e5ff347..d553a4a715 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java @@ -2,11 +2,11 @@ package org.onap.so.db.request.configuration; import org.onap.so.db.request.beans.RequestProcessingData; import org.springframework.data.rest.core.config.RepositoryRestConfiguration; -import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; import org.springframework.stereotype.Component; @Component -public class ExposeEntityIdResourceConfiguration extends RepositoryRestConfigurerAdapter { +public class ExposeEntityIdResourceConfiguration implements RepositoryRestConfigurer { /** * Spring Data Rest hides the ID by default, in order to have it in the JSON you have to manually configure that for diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/application-test.yaml b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/application-test.yaml index 670d16b6c7..d02862b3af 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/application-test.yaml +++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/application-test.yaml @@ -1,9 +1,10 @@ # will be used as entry in DB to say SITE OFF/ON for healthcheck server: - port: 8080 - tomcat: - max-threads: 50 + port: 8080 + tomcat: + threads: + max: 50 ssl-enable: false mso: adapters: @@ -12,11 +13,13 @@ mso: endpoint: http://localhost:8081 site-name: localDevEnv logPath: logs - + # H2 spring: + sleuth: + enabled: false datasource: - jdbc-url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1; + jdbc-url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;MODE=MySQL username: sa password: sa driver-class-name: org.h2.Driver @@ -24,12 +27,13 @@ spring: console: enabled: true path: /h2 - jpa: - show-sql: true + show-sql: true + hibernate: + ddl-auto: none + properties: hibernate: dialect: org.hibernate.dialect.MySQL5Dialect - ddl-auto: none naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy enable-lazy-load-no-trans: true @@ -40,6 +44,3 @@ management: enabled: false basic: enabled: false - - - diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql index e8f2002399..779335db55 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql +++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql @@ -1,5 +1,5 @@ -create table IF NOT EXISTS ACTIVATE_OPERATIONAL_ENV_SERVICE_MODEL_DISTRIBUTION_STATUS ( +CREATE TABLE IF NOT EXISTS ACTIVATE_OPERATIONAL_ENV_SERVICE_MODEL_DISTRIBUTION_STATUS ( REQUEST_ID varchar(255) not null, OPERATIONAL_ENV_ID varchar(255) not null, SERVICE_MODEL_VERSION_ID varchar(255) not null, @@ -12,8 +12,8 @@ create table IF NOT EXISTS ACTIVATE_OPERATIONAL_ENV_SERVICE_MODEL_DISTRIBUTION_S VNF_OPERATIONAL_ENV_ID varchar(255) not null, primary key (REQUEST_ID,OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID) ); - -create table IF NOT EXISTS OPERATION_STATUS ( + +CREATE TABLE IF NOT EXISTS OPERATION_STATUS ( SERVICE_ID varchar(255) not null, OPERATION_ID varchar(255) not null, SERVICE_NAME varchar(255), @@ -27,31 +27,29 @@ create table IF NOT EXISTS OPERATION_STATUS ( FINISHED_AT datetime, primary key (SERVICE_ID,OPERATION_ID) ); - - + + INSERT INTO PUBLIC.OPERATION_STATUS (SERVICE_ID, OPERATION_ID, OPERATION_TYPE, USER_ID, RESULT, OPERATION_CONTENT, PROGRESS, REASON, OPERATE_AT, FINISHED_AT) SELECT * FROM (SELECT 'serviceId', 'operationId', 'operationType', 'userId', 'result', 'operationContent', 'progress', 'reason', '2016-11-24 13:19:1' AS OPERATE_AT, '2016-11-24 13:19:10' AS FINISHED_AT) AS tmp WHERE NOT EXISTS ( - SELECT SERVICE_ID, OPERATION_ID FROM OPERATION_STATUS WHERE + SELECT SERVICE_ID, OPERATION_ID FROM OPERATION_STATUS WHERE SERVICE_ID = 'serviceId' and OPERATION_ID = 'operationId' ) LIMIT 1; - create table IF NOT EXISTS RESOURCE_OPERATION_STATUS ( - SERVICE_ID varchar(255) not null, - OPERATION_ID varchar(255) not null, - RESOURCE_TEMPLATE_UUID varchar(255) not null, - OPER_TYPE varchar(255), - RESOURCE_INSTANCE_ID varchar(255), - JOB_ID varchar(255), - STATUS varchar(255), - PROGRESS varchar(255), - ERROR_CODE varchar(255) , - STATUS_DESCRIPOTION varchar(255) , - primary key (SERVICE_ID,OPERATION_ID,RESOURCE_TEMPLATE_UUID) - ); +CREATE TABLE IF NOT EXISTS RESOURCE_OPERATION_STATUS ( + SERVICE_ID varchar(255) not null, + OPERATION_ID varchar(255) not null, + RESOURCE_TEMPLATE_UUID varchar(255) not null, + OPER_TYPE varchar(255), + RESOURCE_INSTANCE_ID varchar(255), + JOB_ID varchar(255), + STATUS varchar(255), + PROGRESS varchar(255), + ERROR_CODE varchar(255) , + STATUS_DESCRIPOTION varchar(255) , + primary key (SERVICE_ID,OPERATION_ID,RESOURCE_TEMPLATE_UUID) +); -DROP TABLE PUBLIC.INFRA_ACTIVE_REQUESTS IF EXISTS; - CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS( REQUEST_ID VARCHAR NOT NULL SELECTIVITY 100, REQUEST_STATUS VARCHAR SELECTIVITY 1, @@ -105,13 +103,14 @@ CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS( PRODUCT_FAMILY_NAME VARCHAR SELECTIVITY 1, RESOURCE_STATUS_MESSAGE VARCHAR SELECTIVITY 36, WORKFLOW_NAME VARCHAR SELECTIVITY 1, - OPERATION_NAME VARCHAR SELECTIVITY 1 -); + OPERATION_NAME VARCHAR SELECTIVITY 1, + PRIMARY KEY (REQUEST_ID) +); INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES ('00032ab7-3fb3-42e5-965d-8ea592502017', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), ('00093944-bf16-4373-ab9a-3adfe730ff2d', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}', null, 'APIH', null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'), -('001619d2-a297-4a4b-a9f5-e2823c88458f', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, STRINGDECODE('\n\n \n 001619d2-a297-4a4b-a9f5-e2823c88458f\n CREATE_VF_MODULE\n PORTAL\n \n \n test-vscp\n moduleName\n elena_test21\n moduleModelName\n 1.0\n a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\n mtn9\n 381b9ff6c75e4625b7a4182f90fc68d3\n \n \n false\n \n \n\n'), 'NONE', 'RDBTEST', '2016-07-01 14:11:42', null, null, null, 'MODULENAME1', 'moduleModelName', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'); +('001619d2-a297-4a4b-a9f5-e2823c88458f', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, STRINGDECODE('\n\n \n 001619d2-a297-4a4b-a9f5-e2823c88458f\n CREATE_VF_MODULE\n PORTAL\n \n \n test-vscp\n moduleName\n elena_test21\n moduleModelName\n 1.0\n a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\n mtn9\n 381b9ff6c75e4625b7a4182f90fc68d3\n \n \n false\n \n \n\n'), 'NONE', 'RDBTEST', '2016-07-01 14:11:42', null, null, null, 'MODULENAME1', 'moduleModelName', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'); INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES @@ -183,26 +182,26 @@ CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS( OPERATION_NAME VARCHAR SELECTIVITY 1 ); -CREATE TABLE IF NOT EXISTS cloud_api_requests( -`ID` INT(13) NOT NULL AUTO_INCREMENT, -`REQUEST_BODY` LONGTEXT NOT NULL, -`CLOUD_IDENTIFIER` VARCHAR(200) NULL, -`SO_REQUEST_ID` VARCHAR(45) NOT NULL, -`CREATE_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, -PRIMARY KEY (`ID`), -CONSTRAINT fk_cloud_api_req_infra_requests - FOREIGN KEY (SO_REQUEST_ID) - REFERENCES infra_active_requests (REQUEST_ID)); - - +CREATE TABLE IF NOT EXISTS CLOUD_API_REQUESTS( + `ID` INT(13) NOT NULL AUTO_INCREMENT, + `REQUEST_BODY` LONGTEXT NOT NULL, + `CLOUD_IDENTIFIER` VARCHAR(200) NULL, + `SO_REQUEST_ID` VARCHAR(45) NOT NULL, + `CREATE_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`ID`), + CONSTRAINT fk_cloud_api_req_infra_requests + FOREIGN KEY (SO_REQUEST_ID) + REFERENCES infra_active_requests (REQUEST_ID)); + + DROP TABLE PUBLIC.SITE_STATUS IF EXISTS; CREATE CACHED TABLE PUBLIC.SITE_STATUS( SITE_NAME VARCHAR NOT NULL, STATUS VARCHAR, CREATION_TIMESTAMP VARCHAR -); - +); + INSERT INTO PUBLIC.SITE_STATUS(SITE_NAME, STATUS, CREATION_TIMESTAMP) VALUES ('testSite', '0', '2017-11-30 15:48:09'), ('test name', null, null), @@ -210,7 +209,7 @@ INSERT INTO PUBLIC.SITE_STATUS(SITE_NAME, STATUS, CREATION_TIMESTAMP) VALUES ('test name3', '1', null), ('test name4', '1', '2017-11-30 15:48:09'), ('test name update', '0', null); - + DROP TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS IF EXISTS; CREATE CACHED TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS( @@ -219,13 +218,13 @@ CREATE CACHED TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS( LOCK_VERSION int, CREATE_TIME VARCHAR, MODIFY_TIME VARCHAR -); - - +); + + INSERT INTO PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS(DISTRIBUTION_ID, DISTRIBUTION_ID_STATUS, LOCK_VERSION, CREATE_TIME, MODIFY_TIME) VALUES ('1533c4bd-a3e3-493f-a16d-28c20614415e', '', 0, '2017-11-30 15:48:09', '2017-11-30 15:48:09'), ('55429711-809b-4a3b-9ee5-5120d46d9de0', '', 0, '2017-11-30 16:35:36', '2017-11-30 16:35:36'), -('67f0b2d1-9013-4b2b-9914-bbe2288284fb', '', 0, '2017-11-30 15:54:39', '2017-11-30 15:54:39'); +('67f0b2d1-9013-4b2b-9914-bbe2288284fb', '', 0, '2017-11-30 15:54:39', '2017-11-30 15:54:39'); DROP TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS IF EXISTS; @@ -236,13 +235,13 @@ CREATE CACHED TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS( COMPONENT_DISTRIBUTION_STATUS VARCHAR, CREATE_TIME VARCHAR, MODIFY_TIME VARCHAR -); +); + - INSERT INTO PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS(DISTRIBUTION_ID, COMPONENT_NAME, COMPONENT_DISTRIBUTION_STATUS, CREATE_TIME, MODIFY_TIME) VALUES ('1533c4bd-a3e3-493f-a16d-28c20614415e', 'MSO', 'COMPONENT_DONE_OK', '2017-11-30 15:48:09', '2017-11-30 15:48:09'), ('55429711-809b-4a3b-9ee5-5120d46d9de0', 'MSO', 'COMPONENT_DONE_ERROR', '2017-11-30 16:35:36', '2017-11-30 16:35:36'), -('67f0b2d1-9013-4b2b-9914-bbe2288284fb', 'MSO', 'COMPONENT_DONE_OK', '2017-11-30 15:54:39', '2017-11-30 15:54:39'); +('67f0b2d1-9013-4b2b-9914-bbe2288284fb', 'MSO', 'COMPONENT_DONE_OK', '2017-11-30 15:54:39', '2017-11-30 15:54:39'); DROP TABLE PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP IF EXISTS; @@ -252,21 +251,20 @@ CREATE CACHED TABLE PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP( CREATE_TIME VARCHAR, MODIFY_TIME VARCHAR ); - - + + INSERT INTO PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP(DISTRIBUTION_ID, SERVICE_MODEL_VERSION_ID, CREATE_TIME, MODIFY_TIME) VALUES ('1533c4bd-a3e3-493f-a16d-28c20614415e', '7e813ab5-88d3-4fcb-86c0-498c5d7eef9a', '2017-11-30 15:48:08', '2017-11-30 15:48:08'), ('55429711-809b-4a3b-9ee5-5120d46d9de0', 'cc031e75-4442-4d1a-b774-8a2b434e0a50', '2017-11-30 16:35:36', '2017-11-30 16:35:36'), ('67f0b2d1-9013-4b2b-9914-bbe2288284fb', 'eade1e9d-c1ec-4ef3-bc31-60570fba1573', '2017-11-30 15:54:39', '2017-11-30 15:54:39'); -ALTER TABLE PUBLIC.INFRA_ACTIVE_REQUESTS ADD CONSTRAINT PUBLIC.CONSTRAINT_E PRIMARY KEY(REQUEST_ID); ALTER TABLE PUBLIC.SITE_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_C PRIMARY KEY(SITE_NAME); -ALTER TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_7 PRIMARY KEY(DISTRIBUTION_ID); +ALTER TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_7 PRIMARY KEY(DISTRIBUTION_ID); ALTER TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_D PRIMARY KEY(DISTRIBUTION_ID, COMPONENT_NAME); ALTER TABLE PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP ADD CONSTRAINT PUBLIC.CONSTRAINT_6 PRIMARY KEY(DISTRIBUTION_ID, SERVICE_MODEL_VERSION_ID); ALTER TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_DE FOREIGN KEY(DISTRIBUTION_ID) REFERENCES PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS(DISTRIBUTION_ID) NOCHECK; -CREATE TABLE `orchestration_task` ( +CREATE TABLE ORCHESTRATION_TASK ( `TASK_ID` varchar(200) NOT NULL, `REQUEST_ID` varchar(200) NOT NULL, `NAME` varchar(200) NOT NULL, diff --git a/pom.xml b/pom.xml index 54179c4d60..49306e0c76 100644 --- a/pom.xml +++ b/pom.xml @@ -887,6 +887,11 @@ org.springframework.cloud spring-cloud-sleuth-zipkin + + org.projectlombok + lombok + 1.18.38 + @@ -960,10 +965,6 @@ org.junit.jupiter junit-jupiter - - org.junit.vintage - junit-vintage-engine - org.mockito mockito-junit-jupiter diff --git a/so-sdn-clients/pom.xml b/so-sdn-clients/pom.xml index 383fe869b3..7ce34a47f5 100644 --- a/so-sdn-clients/pom.xml +++ b/so-sdn-clients/pom.xml @@ -139,7 +139,7 @@ org.onap.sdnc.northbound generic-resource-api-model-swagger - 3.0.2 + ${sdnc.northbound.version} yaml -- 2.16.6