Skip to content

terrasearch/ValidateSpringYml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Validate all YML files as part of your CI build

This test can be used to validate spring boot (or other) yml files as part of the compilation process. It is primarily aimed at validating basic markup errors and does not know anything about how the properties are actually ued. This test should work on all yml files

  1. Copy the test class ValidateSpringYml from src/test/java/org/springframework/beans/factory/config to the same package location in your project's test source tree.
  2. Edit the @Test methods to meet your needs. Alternatively, retain validateAllYml() which will validate all application and test yml files.

Test log output

Logging output does not appear on the console when running gradle test. Logging output is available at

  • build/reports/test/classes as html
  • buld/test-results/test as xml

Example Notes

  1. This project contains one good and one bad yml file. The "*" test fails because int validates all yml files on the path including the bad yml file in src/test/resources
  2. The test class must be in the spring package because it accesses protected code.

Dependencies

This project was built with the following

  1. Java 8
  2. Gradle 4.2
  3. You can crate a gradle wrapper by running the following command gradle wrapper --gradle-version 4.2

References

About

Validate your yml properties as part of your CI build. Unit test that validates yml files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%