From 16435b21540c137c898d985e58d0929573412a1b Mon Sep 17 00:00:00 2001 From: monxx Date: Sun, 17 May 2020 10:00:51 +0200 Subject: [PATCH] remove test of properties assignment --- generators/app/index.js | 9 ---- ...afkaConfiguredPollingPropertiesIT.java.ejs | 43 ------------------- .../KafkaEmptyPollingPropertiesIT.java.ejs | 43 ------------------- 3 files changed, 95 deletions(-) delete mode 100644 generators/app/templates/src/test/java/package/config/kafkaPropertiesIT/KafkaConfiguredPollingPropertiesIT.java.ejs delete mode 100644 generators/app/templates/src/test/java/package/config/kafkaPropertiesIT/KafkaEmptyPollingPropertiesIT.java.ejs diff --git a/generators/app/index.js b/generators/app/index.js index 6818d96..18c4807 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -148,7 +148,6 @@ module.exports = class extends BaseGenerator { this.clientFramework = this.jhipsterAppConfig.clientFramework; this.clientPackageManager = this.jhipsterAppConfig.clientPackageManager; this.buildTool = this.jhipsterAppConfig.buildTool; - this.mainClass = this.getMainClassName(); // use function in generator-base.js from generator-jhipster this.angularAppName = this.getAngularAppName(); @@ -217,14 +216,6 @@ module.exports = class extends BaseGenerator { if (this.components.includes('consumer') && this.pollingTimeout) { kafkaProperties += `pollingTimeout: ${this.pollingTimeout} `; - this.template( - 'src/test/java/package/config/kafkaPropertiesIT/KafkaConfiguredPollingPropertiesIT.java.ejs', - `${testDir}config/kafkaPropertiesIT/KafkaConfiguredPollingPropertiesIT.java` - ); - this.template( - 'src/test/java/package/config/kafkaPropertiesIT/KafkaEmptyPollingPropertiesIT.java.ejs', - `${testDir}config/kafkaPropertiesIT/KafkaEmptyPollingPropertiesIT.java` - ); } let consumersCpt = 0; diff --git a/generators/app/templates/src/test/java/package/config/kafkaPropertiesIT/KafkaConfiguredPollingPropertiesIT.java.ejs b/generators/app/templates/src/test/java/package/config/kafkaPropertiesIT/KafkaConfiguredPollingPropertiesIT.java.ejs deleted file mode 100644 index dfe2b11..0000000 --- a/generators/app/templates/src/test/java/package/config/kafkaPropertiesIT/KafkaConfiguredPollingPropertiesIT.java.ejs +++ /dev/null @@ -1,43 +0,0 @@ -<%# - Copyright 2013-2020 the original author or authors from the JHipster project. - - This file is part of the JHipster project, see https://www.jhipster.tech/ - for more information. - - 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 <%= packageName %>.config.kafkaPropertiesIT; - -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import <%= packageName %>.<%= mainClass %>; -import <%= packageName %>.config.KafkaProperties; - -import static org.assertj.core.api.Assertions.assertThat; - -@SpringBootTest(classes = <%= mainClass %>.class,properties = "kafka.pollingTimeout=5000") -@DisplayName("Kafka Polling Properties IT") -class KafkaConfiguredPollingPropertiesIT { - - @Autowired - KafkaProperties kafkaProperties; - - @Test - @DisplayName("When Polling property is configured with a specific value Should Return the specific value") - void shouldReturnTheDefaultValue() { - assertThat(kafkaProperties.getPollingTimeout()).isEqualTo(5000); - } - -} diff --git a/generators/app/templates/src/test/java/package/config/kafkaPropertiesIT/KafkaEmptyPollingPropertiesIT.java.ejs b/generators/app/templates/src/test/java/package/config/kafkaPropertiesIT/KafkaEmptyPollingPropertiesIT.java.ejs deleted file mode 100644 index a9fc0cb..0000000 --- a/generators/app/templates/src/test/java/package/config/kafkaPropertiesIT/KafkaEmptyPollingPropertiesIT.java.ejs +++ /dev/null @@ -1,43 +0,0 @@ -<%# - Copyright 2013-2020 the original author or authors from the JHipster project. - - This file is part of the JHipster project, see https://www.jhipster.tech/ - for more information. - - 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 <%= packageName %>.config.kafkaPropertiesIT; - -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import <%= packageName %>.<%= mainClass %>; -import <%= packageName %>.config.KafkaProperties; - -import static org.assertj.core.api.Assertions.assertThat; - -@SpringBootTest(classes = <%= mainClass %>.class,properties = "kafka.pollingTimeout=") -@DisplayName("Kafka Polling Properties IT") -class KafkaEmptyPollingPropertiesIT { - - @Autowired - KafkaProperties kafkaProperties; - - @Test - @DisplayName("When Polling property is configured with a empty value Should Return the default value") - void shouldReturnTheDefaultValue() { - assertThat(kafkaProperties.getPollingTimeout()).isEqualTo(KafkaProperties.DEFAULT_POLL_TIMEOUT); - } - -}