From a456e7e4b70b56fe4fb0c0e82645d12402ce2f78 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Fri, 30 Aug 2019 15:32:13 -0400 Subject: Remove controllerbluprints distribution. Change-Id: I8c7269f97f2b32a0fe8689baaeddfe1e82e0d075 Issue-ID: CCSDK-1663 Signed-off-by: Brinda Santh --- .../controllerblueprints/ApplicationConstants.java | 28 -------- .../ControllerBlueprintsApplication.java | 42 ----------- .../cds/controllerblueprints/DatabaseConfig.java | 61 ---------------- .../ccsdk/cds/controllerblueprints/WebConfig.java | 50 ------------- .../ApplicationSecurityConfigurerAdapter.java | 62 ---------------- .../src/main/resources/application-dev.properties | 70 ------------------ .../src/main/resources/application.properties | 75 ------------------- .../application/src/main/resources/logback.xml | 44 ------------ .../application/src/main/resources/sql/data.sql | 0 .../src/main/resources/sql/schema-local.sql | 83 ---------------------- .../application/src/main/resources/sql/schema.sql | 78 -------------------- .../ControllerBlueprintsApplicationTest.java | 62 ---------------- .../controllerblueprints/VersionSplitTest.java | 49 ------------- .../src/test/resources/application.properties | 58 --------------- .../src/test/resources/logback-test.xml | 35 --------- 15 files changed, 797 deletions(-) delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ApplicationConstants.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ControllerBlueprintsApplication.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/DatabaseConfig.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/WebConfig.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/security/ApplicationSecurityConfigurerAdapter.java delete mode 100755 ms/controllerblueprints/application/src/main/resources/application-dev.properties delete mode 100755 ms/controllerblueprints/application/src/main/resources/application.properties delete mode 100644 ms/controllerblueprints/application/src/main/resources/logback.xml delete mode 100644 ms/controllerblueprints/application/src/main/resources/sql/data.sql delete mode 100644 ms/controllerblueprints/application/src/main/resources/sql/schema-local.sql delete mode 100644 ms/controllerblueprints/application/src/main/resources/sql/schema.sql delete mode 100644 ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplicationTest.java delete mode 100644 ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/VersionSplitTest.java delete mode 100755 ms/controllerblueprints/application/src/test/resources/application.properties delete mode 100644 ms/controllerblueprints/application/src/test/resources/logback-test.xml (limited to 'ms/controllerblueprints/application/src') diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ApplicationConstants.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ApplicationConstants.java deleted file mode 100644 index 9a9fafffc..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ApplicationConstants.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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.onap.ccsdk.cds.controllerblueprints; - -/** - * ApplicationConstants.java Purpose: Provide ControllerBlueprintsApplication Constant Information - * - * @author Brinda Santh - * @version 1.0 - */ -@SuppressWarnings("unused") -public final class ApplicationConstants { - -} diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ControllerBlueprintsApplication.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ControllerBlueprintsApplication.java deleted file mode 100644 index df979c6b3..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ControllerBlueprintsApplication.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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.onap.ccsdk.cds.controllerblueprints; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.reactive.config.EnableWebFlux; - -/** - * @author Brinda Santh - */ -@SpringBootApplication -@EnableWebFlux -@ComponentScan(basePackages = {"org.onap.ccsdk.cds.controllerblueprints"}) -@EnableAutoConfiguration -public class ControllerBlueprintsApplication { - private static Logger log = LoggerFactory.getLogger(ControllerBlueprintsApplication.class); - - public static void main(String[] args) { - log.info("****** Starting Controlled Blueprints Application ******"); - SpringApplication.run(ControllerBlueprintsApplication.class, args); - } - -} \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/DatabaseConfig.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/DatabaseConfig.java deleted file mode 100644 index 8ec4bd4a3..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/DatabaseConfig.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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.onap.ccsdk.cds.controllerblueprints; - -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; -import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -import javax.sql.DataSource; - -/** - * DatabaseConfig.java Purpose: Provide Configuration Generator DatabaseConfig Information - * - * @author Brinda Santh - * @version 1.0 - */ -@Configuration -@EntityScan("org.onap.ccsdk.cds.controllerblueprints.service.domain") -@EnableTransactionManagement -@EnableJpaRepositories("org.onap.ccsdk.cds.controllerblueprints.service.repository") -@EnableJpaAuditing -public class DatabaseConfig { - /** - * This is a entityManagerFactory method - * - * @param dataSource - * @return LocalContainerEntityManagerFactoryBean - */ - - @Bean - public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) { - HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); - vendorAdapter.setGenerateDdl(true); - vendorAdapter.setShowSql(false); - LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); - factory.setJpaVendorAdapter(vendorAdapter); - factory.setPackagesToScan("org.onap.ccsdk.cds.controllerblueprints.service.domain"); - factory.setDataSource(dataSource); - return factory; - } - -} diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/WebConfig.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/WebConfig.java deleted file mode 100644 index e4799bc84..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/WebConfig.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * 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.onap.ccsdk.cds.controllerblueprints; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.config.CorsRegistry; -import org.springframework.web.reactive.config.ResourceHandlerRegistry; -import org.springframework.web.reactive.config.WebFluxConfigurationSupport; - -/** - * WebConfig - * - * @author Brinda Santh 8/13/2018 - */ -@Configuration -@SuppressWarnings("unused") -public class WebConfig extends WebFluxConfigurationSupport { - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("swagger-ui.html") - .addResourceLocations("classpath:/META-INF/resources/"); - - registry.addResourceHandler("/webjars/**") - .addResourceLocations("classpath:/META-INF/resources/webjars/"); - - } - - @Override - public void addCorsMappings(CorsRegistry corsRegistry) { - corsRegistry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range") - .maxAge(3600); - } -} diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/security/ApplicationSecurityConfigurerAdapter.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/security/ApplicationSecurityConfigurerAdapter.java deleted file mode 100644 index d992dd945..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/security/ApplicationSecurityConfigurerAdapter.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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.onap.ccsdk.cds.controllerblueprints.security; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; -import org.springframework.security.config.web.server.ServerHttpSecurity; -import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.web.server.SecurityWebFilterChain; - -@SuppressWarnings("unused") -@EnableWebFluxSecurity -public class ApplicationSecurityConfigurerAdapter { - - @Value("${basic-auth.user-name}") - private String userName; - - @Value("${basic-auth.hashed-pwd}") - private String userHashedPassword; - - private static Logger log = LoggerFactory.getLogger(ApplicationSecurityConfigurerAdapter.class); - - @Bean - public SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception { - - http.csrf().disable(); - http.authorizeExchange() - .pathMatchers("/webjars/**", "/actuator/**").permitAll() - .anyExchange().authenticated() - .and().httpBasic(); - - return http.build(); - } - - @Bean - public MapReactiveUserDetailsService userDetailsService() { - User.UserBuilder userBuilder = User.builder(); - UserDetails defaultUser = userBuilder - .username(userName) - .password(userHashedPassword).roles("USER").build(); - return new MapReactiveUserDetailsService(defaultUser); - } -} \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/main/resources/application-dev.properties b/ms/controllerblueprints/application/src/main/resources/application-dev.properties deleted file mode 100755 index 1d5d04b55..000000000 --- a/ms/controllerblueprints/application/src/main/resources/application-dev.properties +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright © 2017-2018 AT&T Intellectual Property. -# -# 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. -# -appName=ControllerBluePrints -ms_name=org.onap.ccsdk.cds.controllerblueprints -appVersion=1.0.0 - -# Basic Authentication -basic-auth.user-name=ccsdkapps -basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y - -#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex - -logging.level.org.springframework.web=INFO -logging.level.org.hibernate.SQL=warn -logging.level.org.hibernate.type.descriptor.sql=debug - -#To Remove Null in JSON API Response -spring.jackson.default-property-inclusion=non_null - -#Swagger Configuration -swagger.contact.name=Brinda Santh Muthuramalingam -swagger.contact.url=www.onap.com -swagger.contact.email=brindasanth@onap.com - -spring.jpa.properties.hibernate.show_sql=true -spring.jpa.properties.hibernate.use_sql_comments=true -spring.jpa.properties.hibernate.format_sql=true - -# spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables -spring.datasource.url=jdbc:mysql://localhost:3306/sdnctl -spring.datasource.username=sdnctl -spring.datasource.password=sdnctl -spring.datasource.driver-class-name=org.mariadb.jdbc.Driver -spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=none -spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect -# Load Resource Source Mappings -resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability -# Controller Blueprints Core Configuration -blueprintsprocessor.blueprintDeployPath=blueprints/deploy -blueprintsprocessor.blueprintArchivePath=blueprints/archive -blueprintsprocessor.blueprintWorkingPath=blueprints/work -# Controller Blueprint Load Configurations -blueprintsprocessor.loadInitialData=true -blueprintsprocessor.loadBluePrint=false -blueprintsprocessor.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/test-blueprint -blueprintsprocessor.loadModelType=true -blueprintsprocessor.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type -blueprintsprocessor.loadResourceDictionary=true -blueprintsprocessor.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary - -# CBA file extension -blueprintsprocessor.loadCbaExtension=zip - -# Web server config -server.port=8082 diff --git a/ms/controllerblueprints/application/src/main/resources/application.properties b/ms/controllerblueprints/application/src/main/resources/application.properties deleted file mode 100755 index 55770db2d..000000000 --- a/ms/controllerblueprints/application/src/main/resources/application.properties +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright © 2017-2018 AT&T Intellectual Property. -# Modifications Copyright © 2018 IBM. -# Modifications Copyright © 2019 Bell Canada. -# -# 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. -# -appName=ControllerBluePrints -ms_name=org.onap.ccsdk.cds.controllerblueprints -appVersion=1.0.0 - -# Basic Authentication -basic-auth.user-name=ccsdkapps -basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y - -#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex - -logging.level.org.springframework.web=INFO -logging.level.org.hibernate.SQL=warn -logging.level.org.hibernate.type.descriptor.sql=debug - -#To Remove Null in JSON API Response -spring.jackson.default-property-inclusion=non_null - -#Swagger Configuration -swagger.contact.name=CCSDK team -swagger.contact.url=www.onap.org -swagger.contact.email=onap-discuss@lists.onap.org - -spring.jpa.properties.hibernate.show_sql=true -spring.jpa.properties.hibernate.use_sql_comments=true -spring.jpa.properties.hibernate.format_sql=true - -# spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables -spring.datasource.url=jdbc:mysql://db:3306/sdnctl -spring.datasource.username=sdnctl -spring.datasource.password=sdnctl -spring.datasource.driver-class-name=org.mariadb.jdbc.Driver -spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=none -spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect - -# Load Resource Source Mappings -resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability - -# Controller Blueprints Core Configuration -blueprintsprocessor.blueprintDeployPath=/etc/blueprints/deploy -blueprintsprocessor.blueprintArchivePath=/etc/blueprints/archive -blueprintsprocessor.blueprintWorkingPath=/etc/blueprints/work -# Controller Blueprint Load Configurations -# blueprints.load.initial-data may be overridden by ENV variables -blueprintsprocessor.loadInitialData=true -blueprintsprocessor.loadBluePrint=true -blueprintsprocessor.loadBluePrintPaths=/opt/app/onap//model-catalog/blueprint-model/service-blueprint -blueprintsprocessor.loadModelType=true -blueprintsprocessor.loadModeTypePaths=/opt/app/onap//model-catalog/definition-type/starter-type -blueprintsprocessor.loadResourceDictionary=true -blueprintsprocessor.loadResourceDictionaryPaths=/opt/app/onap//model-catalog/resource-dictionary/starter-dictionary - -# CBA file extension -blueprintsprocessor.loadCbaExtension=zip - -# Web server config -server.port=8080 diff --git a/ms/controllerblueprints/application/src/main/resources/logback.xml b/ms/controllerblueprints/application/src/main/resources/logback.xml deleted file mode 100644 index 2af5a92cc..000000000 --- a/ms/controllerblueprints/application/src/main/resources/logback.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - ${defaultPattern} - - - - - - - - - - - - - - - diff --git a/ms/controllerblueprints/application/src/main/resources/sql/data.sql b/ms/controllerblueprints/application/src/main/resources/sql/data.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/ms/controllerblueprints/application/src/main/resources/sql/schema-local.sql b/ms/controllerblueprints/application/src/main/resources/sql/schema-local.sql deleted file mode 100644 index 47e0cce7a..000000000 --- a/ms/controllerblueprints/application/src/main/resources/sql/schema-local.sql +++ /dev/null @@ -1,83 +0,0 @@ --- drop table sdnctl.MODEL_TYPE; --- drop table sdnctl.RESOURCE_DICTIONARY; --- drop table sdnctl.CONFIG_MODEL_CONTENT; --- drop table sdnctl.CONFIG_MODEL; - --- ----------------------------------------------------- --- table CONFIG_MODEL --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS sdnctl.CONFIG_MODEL ( - config_model_id INT(11) NOT NULL AUTO_INCREMENT, - service_uuid VARCHAR(50) NULL DEFAULT NULL, - distribution_id VARCHAR(50) NULL DEFAULT NULL, - service_name VARCHAR(255) NULL DEFAULT NULL, - service_description VARCHAR(255) NULL DEFAULT NULL, - resource_uuid VARCHAR(255) NULL DEFAULT NULL, - resource_instance_name VARCHAR(255) NULL DEFAULT NULL, - resource_name varchar(255) null default null, - resource_version varchar(50) null default null, - resource_type varchar(50) null default null, - artifact_uuid varchar(50) null default null, - artifact_type varchar(50) not null, - artifact_version varchar(25) not null, - artifact_description longtext null default null, - internal_version int(11) null default null, - creation_date datetime not null default current_timestamp, - artifact_name varchar(100) not null, - published varchar(1) not null, - updated_by varchar(100) not null, - tags longtext null default null, - primary key PK_CONFIG_MODEL (config_model_id), - UNIQUE KEY UK_CONFIG_MODEL (artifact_name , artifact_version) -) ENGINE=InnoDB; - - --- ----------------------------------------------------- --- table CONFIG_MODEL_CONTENT --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS sdnctl.CONFIG_MODEL_CONTENT ( - config_model_content_id INT(11) NOT NULL AUTO_INCREMENT, - config_model_id INT NOT NULL, - name VARCHAR(100) NOT NULL, - content_type VARCHAR(50) NOT NULL, - description LONGTEXT NULL DEFAULT NULL, - updated_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - content LONGTEXT NULL DEFAULT NULL, - PRIMARY KEY PK_CONFIG_MODEL_CONTENT (config_model_content_id), - UNIQUE KEY UK_CONFIG_MODEL_CONTENT (config_model_id, name, content_type), - FOREIGN KEY FK_CONFIG_MODEL_CONTENT (config_model_id) REFERENCES sdnctl.CONFIG_MODEL(config_model_id) ON DELETE CASCADE -) ENGINE=InnoDB; - --- ----------------------------------------------------- --- table MODEL_TYPE --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS sdnctl.MODEL_TYPE ( - model_name VARCHAR(100) NOT NULL, - derived_from VARCHAR(100) NOT NULL, - definition_type VARCHAR(100) NOT NULL, - definition LONGTEXT NOT NULL, - version VARCHAR(10) NOT NULL, - description LONGTEXT NOT NULL, - tags LONGTEXT NULL DEFAULT NULL, - creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_by VARCHAR(100) NOT NULL, - PRIMARY KEY PK_MODEL_TYPE (model_name), - INDEX IX_MODEL_TYPE (model_name) -) ENGINE=InnoDB; - - --- ----------------------------------------------------- --- table RESOURCE_DICTIONARY --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS sdnctl.RESOURCE_DICTIONARY ( - name VARCHAR(100) NOT NULL, - data_type VARCHAR(100) NOT NULL, - entry_schema VARCHAR(100) NULL DEFAULT NULL, - definition LONGTEXT NOT NULL, - description LONGTEXT NOT NULL, - tags LONGTEXT NOT NULL, - creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_by VARCHAR(100) NOT NULL, - primary key PK_RESOURCE_DICTIONARY (name), - INDEX IX_RESOURCE_DICTIONARY (name) -) ENGINE=InnoDB; \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/main/resources/sql/schema.sql b/ms/controllerblueprints/application/src/main/resources/sql/schema.sql deleted file mode 100644 index 9c38bec0b..000000000 --- a/ms/controllerblueprints/application/src/main/resources/sql/schema.sql +++ /dev/null @@ -1,78 +0,0 @@ --- ----------------------------------------------------- --- table CONFIG_MODEL --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS configurator.CONFIG_MODEL ( - config_model_id INT(11) NOT NULL AUTO_INCREMENT, - service_uuid VARCHAR(50) NULL DEFAULT NULL, - distribution_id VARCHAR(50) NULL DEFAULT NULL, - service_name VARCHAR(255) NULL DEFAULT NULL, - service_description VARCHAR(255) NULL DEFAULT NULL, - resource_uuid VARCHAR(255) NULL DEFAULT NULL, - resource_instance_name VARCHAR(255) NULL DEFAULT NULL, - resource_name varchar(255) null default null, - resource_version varchar(50) null default null, - resource_type varchar(50) null default null, - artifact_uuid varchar(50) null default null, - artifact_type varchar(50) not null, - artifact_version varchar(25) not null, - artifact_description longtext null default null, - internal_version int(11) null default null, - creation_date datetime not null default current_timestamp, - artifact_name varchar(100) not null, - published varchar(1) not null, - updated_by varchar(100) not null, - tags longtext null default null, - primary key PK_CONFIG_MODEL (config_model_id), - UNIQUE KEY UK_CONFIG_MODEL (artifact_name , artifact_version) -) ENGINE=InnoDB; - - --- ----------------------------------------------------- --- table CONFIG_MODEL_CONTENT --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS configurator.CONFIG_MODEL_CONTENT ( - config_model_content_id INT(11) NOT NULL AUTO_INCREMENT, - config_model_id INT NOT NULL, - name VARCHAR(100) NOT NULL, - content_type VARCHAR(50) NOT NULL, - description LONGTEXT NULL DEFAULT NULL, - updated_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - content LONGTEXT NULL DEFAULT NULL, - PRIMARY KEY PK_CONFIG_MODEL_CONTENT (config_model_content_id), - UNIQUE KEY UK_CONFIG_MODEL_CONTENT (config_model_id, name, content_type), - FOREIGN KEY FK_CONFIG_MODEL_CONTENT (config_model_id) REFERENCES configurator.CONFIG_MODEL(config_model_id) ON DELETE CASCADE -) ENGINE=InnoDB; - --- ----------------------------------------------------- --- table MODEL_TYPE --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS configurator.MODEL_TYPE ( - model_name VARCHAR(100) NOT NULL, - derived_from VARCHAR(100) NOT NULL, - definition_type VARCHAR(100) NOT NULL, - definition LONGTEXT NOT NULL, - version VARCHAR(10) NOT NULL, - description LONGTEXT NOT NULL, - tags LONGTEXT NULL DEFAULT NULL, - creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_by VARCHAR(100) NOT NULL, - PRIMARY KEY PK_MODEL_TYPE (model_name), - INDEX IX_MODEL_TYPE (model_name) -) ENGINE=InnoDB; - - --- ----------------------------------------------------- --- table RESOURCE_DICTIONARY --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS configurator.RESOURCE_DICTIONARY ( - name VARCHAR(100) NOT NULL, - data_type VARCHAR(100) NOT NULL, - entry_schema VARCHAR(100) NULL DEFAULT NULL, - definition LONGTEXT NOT NULL, - description LONGTEXT NOT NULL, - tags LONGTEXT NOT NULL, - creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_by VARCHAR(100) NOT NULL, - primary key PK_RESOURCE_DICTIONARY (name), - INDEX IX_RESOURCE_DICTIONARY (name) -) ENGINE=InnoDB; diff --git a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplicationTest.java b/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplicationTest.java deleted file mode 100644 index 0b9df88b8..000000000 --- a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplicationTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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.onap.ccsdk.cds.controllerblueprints; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.client.support.BasicAuthorizationInterceptor; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) -public class ControllerBlueprintsApplicationTest { - @Autowired - private TestRestTemplate restTemplate; - - @Before - public void setUp(){ - BasicAuthorizationInterceptor bai = new BasicAuthorizationInterceptor("ccsdkapps", "ccsdkapps"); - this.restTemplate.getRestTemplate().getInterceptors().add(bai); - } - - @Test - public void testConfigModel() { - HttpHeaders headers = new HttpHeaders(); - headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); -// ResponseEntity entity = this.restTemplate -// .exchange("/api/v1/config-model/1", HttpMethod.GET, new HttpEntity<>(headers),BlueprintModel.class); -// assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); -// Assert.assertNotNull("failed to get response Config model",entity.getBody()); - } - - @Test - public void testConfigModelFailure() { - HttpHeaders headers = new HttpHeaders(); - headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); -// ResponseEntity entity = this.restTemplate -// .exchange("/api/v1/config-model-not-found/1", HttpMethod.GET, new HttpEntity<>(headers),BlueprintModel.class); -// assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); -// Assert.assertNotNull("failed to get response Config model",entity.getBody()); - } -} diff --git a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/VersionSplitTest.java b/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/VersionSplitTest.java deleted file mode 100644 index 9688b26b1..000000000 --- a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/VersionSplitTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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.onap.ccsdk.cds.controllerblueprints; - -import org.apache.commons.lang3.StringUtils; -import org.junit.Assert; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; - -/** - * VersionSplitTest - * - * @author Brinda Santh - */ -public class VersionSplitTest { - private static Logger log = LoggerFactory.getLogger(VersionSplitTest.class); - - @Test - public void testVersionSplit() { - String version = "1.03.04"; - String[] tokens = StringUtils.split(version, '.'); - Assert.assertNotNull("failed to tokenize", tokens); - Assert.assertEquals("failed to three token ", 3, tokens.length); - } - - @Test - public void encodeTest() { - String name = "ccsdkapps"; - BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(); - String encodedValue = bCryptPasswordEncoder.encode(name); - Assert.assertTrue("Failed to match", bCryptPasswordEncoder.matches(name, encodedValue)); - } -} \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/test/resources/application.properties b/ms/controllerblueprints/application/src/test/resources/application.properties deleted file mode 100755 index a3445d904..000000000 --- a/ms/controllerblueprints/application/src/test/resources/application.properties +++ /dev/null @@ -1,58 +0,0 @@ -# -# Copyright © 2017-2018 AT&T Intellectual Property. -# Modifications Copyright © 2018 IBM. -# -# 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. -# -spring.main.banner-mode=off - -appName=ControllerBluePrints -ms_name=org.onap.ccsdk.cds.controllerblueprints -appVersion=1.0.0 - -# Basic Authentication -basic-auth.user-name=ccsdkapps -basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y - -#To Remove Null in JSON API Response -spring.jackson.default-property-inclusion=non_null - -#Swagger Configuration -swagger.contact.name=Brinda Santh Muthuramalingam -swagger.contact.url=www.onap.com -swagger.contact.email=brindasanth@onap.com - -# Load Resource Source Mappings -resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability - -# Controller Blueprints Core Configuration -blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy -blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive -blueprintsprocessor.blueprintEnrichmentPath=./target/blueprints/enrichment -# Controller Blueprint Load Configurations -blueprintsprocessor.loadInitialData=false -blueprintsprocessor.loadBluePrint=false -blueprintsprocessor.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/test-blueprint -blueprintsprocessor.loadModelType=false -blueprintsprocessor.loadModeTypePaths=./../../../../components/model-catalog/definition-type/starter-type -blueprintsprocessor.loadResourceDictionary=false -blueprintsprocessor.loadResourceDictionaryPaths=./../../../../components/model-catalog/resource-dictionary/starter-dictionary - -# CBA file extension -blueprintsprocessor.loadCbaExtension=zip - -# CBA examples for tests cases -blueprintsprocessor.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprint - -# Web server config -server.port=8080 diff --git a/ms/controllerblueprints/application/src/test/resources/logback-test.xml b/ms/controllerblueprints/application/src/test/resources/logback-test.xml deleted file mode 100644 index 2252939e7..000000000 --- a/ms/controllerblueprints/application/src/test/resources/logback-test.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - %d{HH:mm:ss.SSS} %-5level [%thread] %logger{50} - %msg%n - - - - - - - - - - - - - -- cgit 1.2.3-korg