You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/08/21 16:17:09 UTC

[GitHub] [camel] DenisIstomin commented on pull request #4101: Added testcontainer integration test for Minio

DenisIstomin commented on pull request #4101:
URL: https://github.com/apache/camel/pull/4101#issuecomment-678374169


   Hi @Nayananga,
   You could try to use this approach - `Singleton Containers` https://www.testcontainers.org/test_framework_integration/manual_lifecycle_control/
   So you can define an abstract class and inherit from it:
   ```
   abstract class AbstractContainerBaseTest {
   
       static final MySQLContainer MY_SQL_CONTAINER;
   
       static {
           MY_SQL_CONTAINER = new MySQLContainer();
           MY_SQL_CONTAINER.start();
       }
   }
   
   class FirstTest extends AbstractContainerBaseTest {
   
       @Test
       void someTestMethod() {
           String url = MY_SQL_CONTAINER.getJdbcUrl();
   
           // create a connection and run test as normal
       }
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org