Code Monkey home page Code Monkey logo

validatespringyml's Introduction

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

validatespringyml's People

Contributors

freemansoft avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.