GithubHelp home page GithubHelp logo

workshop's Introduction

Open in GitHub Codespaces

Introduction

This workshop will explain how to use Testcontainers (https://www.testcontainers.com) in your Java applications.

We'll build a sample Spring Boot application, add tests to it, and explore Testcontainers for Java API you need to know to be effective with your tests.

Table of contents

Next steps which you can do in any order based on the interest:

workshop's People

Contributors

bsideup avatar doxic012 avatar eddumelendez avatar gannachernyshova avatar kiftio avatar kiview avatar merikan avatar pioorg avatar rnorth avatar shelajev avatar sivaprasadreddy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workshop's Issues

Workshop Missing details on configuring Kafka

Kafka config not clear

The only thing written is

"Running Kafka in Docker is easy with TestContainers. There is a Testcontainers module providing integration with Kafka and the KafkaContainer abstraction for your code.

Just add it the same way as you added Redis and set the spring.kafka.bootstrap-servers system property.

I tried to do as instructed but the tests are failing.

static final GenericContainer<?> kafka = new GenericContainer("confluentinc/cp-kafka:5.4.6").withExposedPorts(9092);

And in the DynamicPropertySource annotation I wrote

@DynamicPropertySource
public static void configureRedisKafka(DynamicPropertyRegistry registry) {
    Stream.of(redis,kafka).parallel().forEach(GenericContainer::start);
    registry.add("spring.redis.host", redis::getHost);
    registry.add("spring.redis.port", redis::getFirstMappedPort);
    registry.add("spring.kafka.bostrap-servers", kafka::getHost);
}

Thus, what is the correct solution?

Add notice in step 3 that port must be available

I'm just going through the workshop and failed at step 3 "Our very first test" running the dummy test com.example.demo.DemoApplicationTest because the build in tomcat webserver could not be estabilshed.

It turned out that I had to stop Docker Desktop which was running in parallel. So I think they used the same port (8000 or 8080 as these were used by Docker).

I think there should be a note in the description. It may sounds obvious if you are familiar with Spring (which I never had worked with), but as someone like me who started with the official docker tutorial may get struck.

edit:
Maybe add the environment requirements in the workshop - what software has to be installed (and maybe how)

Licensing and reusing

Working on my Testcontainers presentation I wanted to create a sample/simple application with some use cases for the live coding section. However, in the meantime, I have found this workshop. I wonder what is the license of that project and can I use it and adapt to my needs (such as a variant in Spock or JUnit 5)?

Of course with the proper attribution where does this project come from.

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.