Skip to content
This repository was archived by the owner on Jul 14, 2024. It is now read-only.

Latest commit

 

History

History
32 lines (25 loc) · 1.72 KB

File metadata and controls

32 lines (25 loc) · 1.72 KB

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