Skip to content

Reuse @TestContainers and @Container #11

@hantsy

Description

@hantsy

I found there is a new annotation @TestContainer added to control testcontainer Container. https://github.com/arquillian/arquillian-testcontainers/blob/main/src/main/java/org/jboss/arquillian/testcontainers/TestContainersObserver.java#L28

The basic support of Spring Boot testcontiners just adds a @ServiceConnection to the container declarations to setup the connection properties automatically.

@SpringBootTest
@Testcontainers// from testcontainers
class MyTeset {

   @Container // from testcontainers
   @ServiceConnection // from spring Boot
   static AContainer container = ...
}

If possible, reuse the testcontainers existing @Testcontainers and @Container to controll the container lifecycle, and ensure Arquillian sets up the application server adapter's properties after the successful waiting strategy. Then perform the deployment that is defined by @Deployment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions