From c9021e067a4091f671165a76172ae81d177dde15 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Mon, 19 Jul 2021 14:56:14 -0300 Subject: [PATCH] Initial spring-boot generator. --- cli/commands.js | 3 + generators/generator-list.js | 1 + .../__snapshots__/generator.spec.cjs.snap | 80 +++++++++ generators/spring-boot/config.cjs | 27 ++++ generators/spring-boot/constants.cjs | 23 +++ generators/spring-boot/files.cjs | 46 ++++++ generators/spring-boot/generator.spec.cjs | 58 +++++++ generators/spring-boot/index.cjs | 153 ++++++++++++++++++ generators/spring-boot/mixin.cjs | 77 +++++++++ generators/spring-boot/options.cjs | 19 +++ .../build.gradle.jhi.spring-boot.ejs | 29 ++++ .../templates/pom.xml.jhi.spring-boot.ejs | 43 +++++ .../java/package/Application.java.jhi.ejs | 31 ++++ .../resources/application.properties.jhi.ejs | 19 +++ .../package/ApplicationTests.java.jhi.ejs | 31 ++++ 15 files changed, 640 insertions(+) create mode 100644 generators/spring-boot/__snapshots__/generator.spec.cjs.snap create mode 100644 generators/spring-boot/config.cjs create mode 100644 generators/spring-boot/constants.cjs create mode 100644 generators/spring-boot/files.cjs create mode 100644 generators/spring-boot/generator.spec.cjs create mode 100644 generators/spring-boot/index.cjs create mode 100644 generators/spring-boot/mixin.cjs create mode 100644 generators/spring-boot/options.cjs create mode 100644 generators/spring-boot/templates/build.gradle.jhi.spring-boot.ejs create mode 100644 generators/spring-boot/templates/pom.xml.jhi.spring-boot.ejs create mode 100644 generators/spring-boot/templates/src/main/java/package/Application.java.jhi.ejs create mode 100644 generators/spring-boot/templates/src/main/resources/application.properties.jhi.ejs create mode 100644 generators/spring-boot/templates/src/test/java/package/ApplicationTests.java.jhi.ejs diff --git a/cli/commands.js b/cli/commands.js index ccef78487e4..4e119a172b4 100644 --- a/cli/commands.js +++ b/cli/commands.js @@ -178,6 +178,9 @@ const defaultCommands = { desc: 'Run a module or custom generator', argument: ['[generator]'], }, + 'spring-boot': { + desc: 'Create a Spring Boot application (alpha)', + }, 'spring-service': { alias: 'service', desc: 'Create a new Spring service bean', diff --git a/generators/generator-list.js b/generators/generator-list.js index 51dbbc51a08..8efd0244a2a 100644 --- a/generators/generator-list.js +++ b/generators/generator-list.js @@ -51,6 +51,7 @@ const Generators = { GENERATOR_PAGE: 'page', GENERATOR_PROJECT_NAME: 'project-name', GENERATOR_SERVER: 'server', + GENERATOR_SPRING_BOOT: 'spring-boot', }; module.exports = Generators; diff --git a/generators/spring-boot/__snapshots__/generator.spec.cjs.snap b/generators/spring-boot/__snapshots__/generator.spec.cjs.snap new file mode 100644 index 00000000000..dbd15f80f74 --- /dev/null +++ b/generators/spring-boot/__snapshots__/generator.spec.cjs.snap @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`JHipster spring-boot generator with add option and default config should write only spring-boot files and match snapshot 1`] = ` +Object { + ".yo-rc.json": Object { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/JhipsterApp.java": Object { + "stateCleared": "modified", + }, + "src/main/resources/application.properties": Object { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/JhipsterAppTests.java": Object { + "stateCleared": "modified", + }, +} +`; + +exports[`JHipster spring-boot generator with default config should write java files and match snapshot 1`] = ` +Object { + ".editorconfig": Object { + "stateCleared": "modified", + }, + ".gitattributes": Object { + "stateCleared": "modified", + }, + ".gitignore": Object { + "stateCleared": "modified", + }, + ".huskyrc": Object { + "stateCleared": "modified", + }, + ".lintstagedrc.js": Object { + "stateCleared": "modified", + }, + ".mvn/wrapper/MavenWrapperDownloader.java": Object { + "stateCleared": "modified", + }, + ".mvn/wrapper/maven-wrapper.jar": Object { + "stateCleared": "modified", + }, + ".mvn/wrapper/maven-wrapper.properties": Object { + "stateCleared": "modified", + }, + ".prettierignore": Object { + "stateCleared": "modified", + }, + ".prettierrc.yml": Object { + "stateCleared": "modified", + }, + ".yo-rc.json": Object { + "stateCleared": "modified", + }, + "README.md": Object { + "stateCleared": "modified", + }, + "mvnw": Object { + "stateCleared": "modified", + }, + "mvnw.cmd": Object { + "stateCleared": "modified", + }, + "package.json": Object { + "stateCleared": "modified", + }, + "pom.xml": Object { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/JhipsterApp.java": Object { + "stateCleared": "modified", + }, + "src/main/resources/application.properties": Object { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/JhipsterAppTests.java": Object { + "stateCleared": "modified", + }, +} +`; diff --git a/generators/spring-boot/config.cjs b/generators/spring-boot/config.cjs new file mode 100644 index 00000000000..1a3bde87e79 --- /dev/null +++ b/generators/spring-boot/config.cjs @@ -0,0 +1,27 @@ +/** + * Copyright 2013-2021 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 + * + * https://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. + */ +/** Config required at .yo-rc.json */ +const requiredConfig = {}; + +/** Default config for templates */ +const defaultConfig = { + ...requiredConfig, +}; + +module.exports = { requiredConfig, defaultConfig }; diff --git a/generators/spring-boot/constants.cjs b/generators/spring-boot/constants.cjs new file mode 100644 index 00000000000..a23ad62b2e5 --- /dev/null +++ b/generators/spring-boot/constants.cjs @@ -0,0 +1,23 @@ +/** + * Copyright 2013-2021 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 + * + * https://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. + */ +const SPRING_BOOT_VERSION = '2.5.2'; + +module.exports = { + SPRING_BOOT_VERSION, +}; diff --git a/generators/spring-boot/files.cjs b/generators/spring-boot/files.cjs new file mode 100644 index 00000000000..39c1e9a835d --- /dev/null +++ b/generators/spring-boot/files.cjs @@ -0,0 +1,46 @@ +/** + * Copyright 2013-2021 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 + * + * https://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. + */ +const { SRC_MAIN_JAVA_DIR, SRC_MAIN_RESOURCES_DIR, SRC_TEST_JAVA_DIR } = require('../java/constants.cjs'); + +module.exports.files = { + springBootProject: [ + { + templates: ['pom.xml.jhi.spring-boot'], + }, + { + path: SRC_MAIN_RESOURCES_DIR, + templates: ['application.properties.jhi'], + }, + { + path: SRC_MAIN_JAVA_DIR, + templates: [ + { file: 'package/Application.java.jhi', renameTo: generator => `${generator.packageFolder}/${generator.javaMainClass}.java.jhi` }, + ], + }, + { + path: SRC_TEST_JAVA_DIR, + templates: [ + { + file: 'package/ApplicationTests.java.jhi', + renameTo: generator => `${generator.packageFolder}/${generator.javaMainClass}Tests.java.jhi`, + }, + ], + }, + ], +}; diff --git a/generators/spring-boot/generator.spec.cjs b/generators/spring-boot/generator.spec.cjs new file mode 100644 index 00000000000..021423e21bd --- /dev/null +++ b/generators/spring-boot/generator.spec.cjs @@ -0,0 +1,58 @@ +/** + * Copyright 2013-2021 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 + * + * https://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. + */ +const expect = require('expect'); +const path = require('path'); + +const { basicTests, testBlueprintSupport } = require('../../test/support/index.cjs'); +const { skipPrettierHelpers: helpers } = require('../../test/utils/utils'); +const { requiredConfig, defaultConfig } = require('./config.cjs'); + +const generatorPath = path.join(__dirname, 'index.cjs'); + +describe('JHipster spring-boot generator', () => { + basicTests({ + requiredConfig, + defaultConfig, + customPrompts: {}, + generatorPath, + }); + describe('blueprint support', () => testBlueprintSupport('spring-boot')); + describe('with', () => { + describe('default config', () => { + let runResult; + before(async () => { + runResult = await helpers.run(generatorPath); + }); + it('should write java files and match snapshot', () => { + expect(runResult.getStateSnapshot()).toMatchSnapshot(); + }); + }); + }); + describe('with add option and', () => { + describe('default config', () => { + let runResult; + before(async () => { + runResult = await helpers.run(generatorPath).withOptions({ add: true }); + }); + it('should write only spring-boot files and match snapshot', () => { + expect(runResult.getStateSnapshot()).toMatchSnapshot(); + }); + }); + }); +}); diff --git a/generators/spring-boot/index.cjs b/generators/spring-boot/index.cjs new file mode 100644 index 00000000000..cda90784677 --- /dev/null +++ b/generators/spring-boot/index.cjs @@ -0,0 +1,153 @@ +/** + * Copyright 2013-2021 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 + * + * https://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. + */ +/* eslint-disable consistent-return */ +const chalk = require('chalk'); +const { mixBlueprintGenerator } = require('generator-jhipster/support'); + +const { GENERATOR_PROJECT_NAME, GENERATOR_INIT, GENERATOR_JAVA, GENERATOR_SPRING_BOOT } = require('../generator-list'); +const { files } = require('./files.cjs'); + +const MixedGenerator = mixBlueprintGenerator(GENERATOR_PROJECT_NAME, GENERATOR_INIT, GENERATOR_JAVA, GENERATOR_SPRING_BOOT); + +module.exports = class extends MixedGenerator { + constructor(args, opts, features) { + super(args, opts, { jhipsterModular: true, unique: 'namespace', ...features }); + + // Register options available to cli. + if (!this.fromBlueprint) { + this.registerCommonOptions(); + this.registerProjectNameOptions(); + this.registerInitOptions(); + this.registerJavaOptions(); + this.registerSpringBootOptions(); + } + + if (this.options.help) return; + + if (this.options.defaults) { + this.configureProjectName(); + this.configureInit(); + this.configureJava(); + this.configureSpringBoot(); + } + } + + async _beforeQueue() { + if (!this.fromBlueprint) { + if (this.shouldComposeModular()) { + await this.dependsOnJHipster(GENERATOR_JAVA); + } + await this.composeWithBlueprints(GENERATOR_SPRING_BOOT); + } + } + + _initializing() { + return { + validateFromCli() { + this.checkInvocationFromCLI(); + }, + sayHello() { + if (!this.showHello()) return; + this.log(chalk.white('⬢ Welcome to the JHipster Spring Boot ⬢')); + }, + loadRuntimeOptions() { + this.loadRuntimeOptions(); + }, + loadOptionsConstants() { + this.loadSpringBootOptionsConstants(); + }, + }; + } + + get initializing() { + if (this.delegateToBlueprint) return; + return this._initializing(); + } + + _configuring() { + return { + configure() { + this.configureProjectName(); + this.configureInit(); + this.configureJava(); + this.configureSpringBoot(); + }, + }; + } + + get configuring() { + if (this.delegateToBlueprint) return; + return this._configuring(); + } + + _composing() { + return { + async compose() { + if (!this.shouldComposeModular()) return; + }, + }; + } + + get composing() { + if (this.delegateToBlueprint) return; + return this._composing(); + } + + _loading() { + return { + loadConstants() { + this.loadProjectNameConstants(); + this.loadInitConstants(); + this.loadJavaConstants(); + this.loadSpringBootConstants(); + }, + loadConfig() { + this.loadProjectNameConfig(); + this.loadInitConfig(); + this.loadJavaConfig(); + this.loadSpringBootConfig(); + }, + loadDerivedConfig() { + this.loadDerivedProjectNameConfig(); + this.loadDerivedInitConfig(); + this.loadDerivedJavaConfig(); + this.loadDerivedSpringBootConfig(); + }, + }; + } + + get loading() { + if (this.delegateToBlueprint) return; + return this._loading(); + } + + _writing() { + return { + async writeFiles() { + if (this.shouldSkipFiles()) return; + await this.writeFilesToDisk(files); + }, + }; + } + + get writing() { + if (this.delegateToBlueprint) return; + return this._writing(); + } +}; diff --git a/generators/spring-boot/mixin.cjs b/generators/spring-boot/mixin.cjs new file mode 100644 index 00000000000..ed8cd7b0f6b --- /dev/null +++ b/generators/spring-boot/mixin.cjs @@ -0,0 +1,77 @@ +/** + * Copyright 2013-2021 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 + * + * https://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. + */ +const { defaults } = require('lodash'); +const { requiredConfig, defaultConfig } = require('./config.cjs'); +const { options } = require('./options.cjs'); +const { SPRING_BOOT_VERSION } = require('./constants.cjs'); + +module.exports.mixin = parent => + class extends parent { + /** + * Register and parse spring-boot options. + */ + registerSpringBootOptions() { + this.jhipsterOptions(options); + } + + /** + * Load required spring-boot configs into config. + */ + configureSpringBoot() { + this.config.defaults(requiredConfig); + } + + /** + * Load spring-boot configs into into. + * all variables should be set to into, + * all variables should be referred from config, + * @param {any} config - config to load config from + * @param {any} into - destination context to use default is context + */ + loadSpringBootConfig(config = this.jhipsterConfig, into = this) { + config = defaults({}, config, defaultConfig); + } + + /** + * Load derived spring-boot configs into fromInto. + * @param {any} fromInto - source/destination context + */ + loadDerivedSpringBootConfig(fromInto = this) {} + + /** + * Load derived spring-boot configs into 'into'. + * @param {Object} into - destination context + */ + loadSpringBootConstants(into = this) { + into.SPRING_BOOT_VERSION = SPRING_BOOT_VERSION; + } + + /** + * Load derived spring-boot configs into 'into'. + * @param {Object} into - destination context + */ + loadSpringBootOptionsConstants(into = this) {} + + /** + * Compose with selected spring-boot. + */ + async composeWithSelectedSpringBoot(config = this.jhipsterConfig) { + config = defaults({}, config, defaultConfig); + } + }; diff --git a/generators/spring-boot/options.cjs b/generators/spring-boot/options.cjs new file mode 100644 index 00000000000..c66f36d14ba --- /dev/null +++ b/generators/spring-boot/options.cjs @@ -0,0 +1,19 @@ +/** + * Copyright 2013-2021 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 + * + * https://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. + */ +module.exports.options = {}; diff --git a/generators/spring-boot/templates/build.gradle.jhi.spring-boot.ejs b/generators/spring-boot/templates/build.gradle.jhi.spring-boot.ejs new file mode 100644 index 00000000000..836d8555bb7 --- /dev/null +++ b/generators/spring-boot/templates/build.gradle.jhi.spring-boot.ejs @@ -0,0 +1,29 @@ +<%# + Copyright 2013-2021 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 + + https://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. +-%> +<&_ if (fragment.pluginsSection) { -&> + id 'org.springframework.boot' version '<%= SPRING_BOOT_VERSION %>' + id 'io.spring.dependency-management' version '1.0.11.RELEASE' +<&_ } -&> +<&_ if (fragment.dependenciesSection) { -&> + implementation 'org.springframework.boot:spring-boot-starter' + testImplementation 'org.springframework.boot:spring-boot-starter-test' +<&_ } -&> +<&_ if (fragment.testSection) { -&> + useJUnitPlatform() +<&_ } -&> diff --git a/generators/spring-boot/templates/pom.xml.jhi.spring-boot.ejs b/generators/spring-boot/templates/pom.xml.jhi.spring-boot.ejs new file mode 100644 index 00000000000..4f847b697c8 --- /dev/null +++ b/generators/spring-boot/templates/pom.xml.jhi.spring-boot.ejs @@ -0,0 +1,43 @@ +<%# + Copyright 2013-2021 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 + + https://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. +-%> +<&_ if (fragment.parentSection) { -&> + + org.springframework.boot + spring-boot-starter-parent + <%= SPRING_BOOT_VERSION %> + + +<&_ } -&> +<&_ if (fragment.dependenciesSection) { -&> + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-test + test + +<&_ } -&> +<&_ if (fragment.buildPluginsSection) { -&> + + org.springframework.boot + spring-boot-maven-plugin + +<&_ } -&> diff --git a/generators/spring-boot/templates/src/main/java/package/Application.java.jhi.ejs b/generators/spring-boot/templates/src/main/java/package/Application.java.jhi.ejs new file mode 100644 index 00000000000..065fa52f9cd --- /dev/null +++ b/generators/spring-boot/templates/src/main/java/package/Application.java.jhi.ejs @@ -0,0 +1,31 @@ +<%# + Copyright 2013-2021 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 + + https://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 %>; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class <%= javaMainClass %> { + + public static void main(String[] args) { + SpringApplication.run(<%= javaMainClass %>.class, args); + } + +} diff --git a/generators/spring-boot/templates/src/main/resources/application.properties.jhi.ejs b/generators/spring-boot/templates/src/main/resources/application.properties.jhi.ejs new file mode 100644 index 00000000000..1c55e6b1f25 --- /dev/null +++ b/generators/spring-boot/templates/src/main/resources/application.properties.jhi.ejs @@ -0,0 +1,19 @@ +<%# + Copyright 2013-2021 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 + + https://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. +-%> +<&- fragments.render({ join: '\n\n' }) &> diff --git a/generators/spring-boot/templates/src/test/java/package/ApplicationTests.java.jhi.ejs b/generators/spring-boot/templates/src/test/java/package/ApplicationTests.java.jhi.ejs new file mode 100644 index 00000000000..1ded4a3520d --- /dev/null +++ b/generators/spring-boot/templates/src/test/java/package/ApplicationTests.java.jhi.ejs @@ -0,0 +1,31 @@ +<%# + Copyright 2013-2021 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 + + https://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 %>; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class <%= javaMainClass %>Tests { + + @Test + void contextLoads() { + } + +}