Giter VIP home page Giter VIP logo

Comments (4)

sivaprasadreddy avatar sivaprasadreddy commented on May 24, 2024

I remember changing it to use @DynamicPropertySource and reverting it back to ApplicationContextInitializer for some reason. Couldn't recollect the reason off top of my head.

Basically, I am aiming for having separate classes for Database/Localstack etc containers so that I can use them separately for specific scenarios, or use them all combined to run integration tests.

For example, if I want to run Spring Data JPA repository tests with @DataJpaTest I would like to use DBContainerInitializer. If I want to run some integration test with @SpringBootTest then I would like to use same DBContainerInitializer and LocalStackContainerInitializer without having to configure DB container for integration tests again separately.

If that can be done with @DynamicPropertiesSource then we can update it.

from generator-springboot.

rajadilipkolli avatar rajadilipkolli commented on May 24, 2024

I will check sharing of containers for multiple tests from different classes

from generator-springboot.

rajadilipkolli avatar rajadilipkolli commented on May 24, 2024

Please go through this link https://rieckpil.de/reuse-containers-with-testcontainers-for-fast-integration-tests/ it helps to use @dynamicproperties

from generator-springboot.

sivaprasadreddy avatar sivaprasadreddy commented on May 24, 2024

In order to use @DynamicPropertiesSource we need to have a base class with ALL the containers defined. It would become bulky as and when we add more containers. Also, ApplicationContextInitializers play nice when running tests parallelly as opposed to having a base class with static containers.

So, for now, let us continue with current approach.

from generator-springboot.

Related Issues (20)

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.