Git Product home page Git Product logo

spek-spring-utils's Introduction

spek-spring-utils's People

Contributors

themkat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spek-spring-utils's Issues

MockBean support

Someone mentioned that MockBean would be a good feature to add, as many people use it. Some research would have to be done on how to do this as clean as possible. Feel free to add thoughts here if you have any.

application properties are not read

Problem

When creating a Spring Context (using the DSL), application properties is not read unless explicitly stated. The reason it was prievously believed to be working is that Spring still starts H2 automatically, but with a default name and settings (which was not checked earlier). I forgot that application.properties autoloading was a Spring Boot feature, so a seperate Spring Boot context (or modifying the existing one) should probably be added.

How to reproduce

  • Create a Spring Boot application.
  • Do any operations which reads from application properties (either yaml file or .properties), and do NOT specify property sources.

Expected behaviour

Application properties are read and can be referenced either by using Environment, doing operations on database or something else. This reflects what is expected from Spring in JUnit tests, and this project aims to give you all the same features.

Possible solution

There are several possible solutions.

  • Do SpringApplication.run to get ApplicationContext. The downside here is that it may interfere with CommandLineRunners (which are common in many batch systems).
  • Do manual handling of property sources. Check if files exists and add them manually to the context.
  • Some unknown internal Spring settings that can be done to get it to read the properties.

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.