-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
199 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
invoker.goals=clean process-classes -e | ||
invoker.goals=clean test -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
src/it/spring-fat/src/main/resources/META-INF/spring.factories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Logging Systems | ||
org.springframework.boot.logging.LoggingSystemFactory=\ | ||
org.springframework.boot.logging.logback.LogbackLoggingSystem.Factory,\ | ||
org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.Factory,\ | ||
org.springframework.boot.logging.java.JavaLoggingSystem.Factory | ||
|
||
# PropertySource Loaders | ||
org.springframework.boot.env.PropertySourceLoader=\ | ||
org.springframework.boot.env.PropertiesPropertySourceLoader,\ | ||
org.springframework.boot.env.YamlPropertySourceLoader | ||
|
||
# ConfigData Location Resolvers | ||
org.springframework.boot.context.config.ConfigDataLocationResolver=\ | ||
org.springframework.boot.context.config.ConfigTreeConfigDataLocationResolver,\ | ||
org.springframework.boot.context.config.StandardConfigDataLocationResolver | ||
|
||
# ConfigData Loaders | ||
org.springframework.boot.context.config.ConfigDataLoader=\ | ||
org.springframework.boot.context.config.ConfigTreeConfigDataLoader,\ | ||
org.springframework.boot.context.config.StandardConfigDataLoader | ||
|
||
# Application Context Factories | ||
org.springframework.boot.ApplicationContextFactory=\ | ||
org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext.Factory,\ | ||
org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext.Factory | ||
|
||
# Run Listeners | ||
org.springframework.boot.SpringApplicationRunListener=\ | ||
org.springframework.boot.context.event.EventPublishingRunListener | ||
|
||
# Error Reporters | ||
org.springframework.boot.SpringBootExceptionReporter=\ | ||
org.springframework.boot.diagnostics.FailureAnalyzers | ||
|
||
# Application Context Initializers | ||
org.springframework.context.ApplicationContextInitializer=\ | ||
org.springframework.boot.context.ConfigurationWarningsApplicationContextInitializer,\ | ||
org.springframework.boot.context.ContextIdApplicationContextInitializer,\ | ||
org.springframework.boot.context.config.DelegatingApplicationContextInitializer,\ | ||
org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer,\ | ||
org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer | ||
|
||
# Application Listeners | ||
org.springframework.context.ApplicationListener=\ | ||
org.springframework.boot.ClearCachesApplicationListener,\ | ||
org.springframework.boot.builder.ParentContextCloserApplicationListener,\ | ||
org.springframework.boot.context.FileEncodingApplicationListener,\ | ||
org.springframework.boot.context.config.AnsiOutputApplicationListener,\ | ||
org.springframework.boot.context.config.DelegatingApplicationListener,\ | ||
org.springframework.boot.context.logging.LoggingApplicationListener,\ | ||
org.springframework.boot.env.EnvironmentPostProcessorApplicationListener | ||
|
||
# Environment Post Processors | ||
org.springframework.boot.env.EnvironmentPostProcessor=\ | ||
org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor,\ | ||
org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor,\ | ||
org.springframework.boot.env.RandomValuePropertySourceEnvironmentPostProcessor,\ | ||
org.springframework.boot.env.SpringApplicationJsonEnvironmentPostProcessor,\ | ||
org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor,\ | ||
org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor | ||
|
||
# Failure Analyzers | ||
org.springframework.boot.diagnostics.FailureAnalyzer=\ | ||
org.springframework.boot.context.config.ConfigDataNotFoundFailureAnalyzer,\ | ||
org.springframework.boot.context.properties.IncompatibleConfigurationFailureAnalyzer,\ | ||
org.springframework.boot.context.properties.NotConstructorBoundInjectionFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.BeanCurrentlyInCreationFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.BeanDefinitionOverrideFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.BeanNotOfRequiredTypeFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.BindFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.BindValidationFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.UnboundConfigurationPropertyFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.MutuallyExclusiveConfigurationPropertiesFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.NoUniqueBeanDefinitionFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.PortInUseFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.ValidationExceptionFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.InvalidConfigurationPropertyNameFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.InvalidConfigurationPropertyValueFailureAnalyzer,\ | ||
org.springframework.boot.diagnostics.analyzer.PatternParseFailureAnalyzer,\ | ||
org.springframework.boot.liquibase.LiquibaseChangelogMissingFailureAnalyzer,\ | ||
org.springframework.boot.web.context.MissingWebServerFactoryBeanFailureAnalyzer,\ | ||
org.springframework.boot.web.embedded.tomcat.ConnectorStartFailureAnalyzer | ||
|
||
# Failure Analysis Reporters | ||
org.springframework.boot.diagnostics.FailureAnalysisReporter=\ | ||
org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter | ||
|
||
# Database Initializer Detectors | ||
org.springframework.boot.sql.init.dependency.DatabaseInitializerDetector=\ | ||
org.springframework.boot.flyway.FlywayDatabaseInitializerDetector,\ | ||
org.springframework.boot.jdbc.AbstractDataSourceInitializerDatabaseInitializerDetector,\ | ||
org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializerDetector,\ | ||
org.springframework.boot.liquibase.LiquibaseDatabaseInitializerDetector,\ | ||
org.springframework.boot.orm.jpa.JpaDatabaseInitializerDetector,\ | ||
org.springframework.boot.r2dbc.init.R2dbcScriptDatabaseInitializerDetector | ||
|
||
# Depends On Database Initialization Detectors | ||
org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\ | ||
org.springframework.boot.sql.init.dependency.AnnotationDependsOnDatabaseInitializationDetector,\ | ||
org.springframework.boot.jdbc.SpringJdbcDependsOnDatabaseInitializationDetector,\ | ||
org.springframework.boot.jooq.JooqDependsOnDatabaseInitializationDetector,\ | ||
org.springframework.boot.orm.jpa.JpaDependsOnDatabaseInitializationDetector |
74 changes: 74 additions & 0 deletions
74
src/it/spring-fat/src/test/java/org/eolang/jeo/spring/ApplicationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2016-2024 Objectionary.com | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package org.eolang.jeo.spring; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.boot.test.web.client.TestRestTemplate; | ||
import org.springframework.boot.test.web.server.LocalServerPort; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
|
||
/** | ||
* Integration test for Application. | ||
* @since 0.2 | ||
*/ | ||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | ||
class ApplicationTest { | ||
|
||
@Autowired | ||
private TestRestTemplate template; | ||
|
||
@LocalServerPort | ||
private int port; | ||
|
||
@Test | ||
void startupsServerAndMakesGetRequest() { | ||
final ResponseEntity<String> resp = this.template.getForEntity( | ||
String.format("http://localhost:%d/hello", this.port), | ||
String.class | ||
); | ||
Assertions.assertEquals( | ||
HttpStatus.OK, | ||
resp.getStatusCode(), | ||
"Status code is not OK" | ||
); | ||
Assertions.assertNotNull( | ||
resp.getBody(), | ||
"Response body is empty" | ||
); | ||
final String expected = "Glad to see you, Fat Spring..."; | ||
Assertions.assertTrue( | ||
resp.getBody().contains(expected), | ||
String.format( | ||
"Hello response is not correct. The body: %s%n should contain '%s'", | ||
resp.getBody(), | ||
expected | ||
) | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters