npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-jhipster-testcontainers

v1.1.0

Published

A Jhipster module to run integration tests with java testcontainers

Downloads

26

Readme

generator-jhipster-testcontainers

NPM version Build Status Dependency Status

A Jhipster module to run integration tests with java Testcontainers

Introduction

This is a JHipster module to run Jhipster @SpringBootTest tests against on production database. A database container will automatically boot during the test startup phase.

Usage

npm install -g generator-jhipster-testcontainers

Run the module from your jhipster project folder:

yo jhipster-testcontainers

Run tests with the testcontainers spring profile

# maven
./mvnw verify -Dspring.profiles.active=testcontainers

# gradle
./gradlew integrationTest -Ptestcontainers

Example with mysql:

🐳 [mysql:8.0.19]                        : Creating container for image: mysql:8.0.19
🐳 [mysql:8.0.19]                        : Starting container with ID: ce2bc59ebbd1e02d0cffa6f04fca43a10c516818a2d8be90720f833a639151b6
🐳 [mysql:8.0.19]                        : Container mysql:8.0.19 is starting: ce2bc59ebbd1e02d0cffa6f04fca43a10c516818a2d8be90720f833a639151b6
🐳 [mysql:8.0.19]                        : Waiting for database connection to become available at jdbc:mysql://localhost:32770/academydb using query 'SELECT 1'
🐳 [mysql:8.0.19]                        : Container is started (JDBC URL: jdbc:mysql://localhost:32770/testdb)
🐳 [mysql:8.0.19]                        : Container mysql:8.0.19 started in PT17.8709687S
com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.

IMPORTANT: H2 will still be the default option, use testcontainers profile to test using testcontainers.

How it works

As for testcontainers documentation:

As long as you have Testcontainers and the appropriate JDBC driver on your classpath, you can simply modify regular JDBC connection URLs to get a fresh containerized instance of the database each time your application starts up.

This module simply adds a properties file in your test resources: application-testcontainers.yml and uses it when launching tests with testcontainers profile.

This is how mysql properties look like.

spring.datasource.driver-class-name=org.testcontainers.jdbc.ContainerDatabaseDriver
spring.datasource.url=jdbc:tc:mysql:8.0.19://hostname/testdb

Additional steps

Mysql, Postgres, Mariadb

No additional steps required

SQL Server

Due to licencing restrictions you are required to accept an EULA for this container image. To indicate that you accept the MS SQL Server image EULA, place a file at the root of the classpath named container-license-acceptance.txt, e.g. at src/test/resources/container-license-acceptance.txt. This file should contain the line:

mcr.microsoft.com/mssql/server:latest

Oracle

Modify the file testcontainers.properties, containing oracle.container.image=IMAGE, where IMAGE is a suitable image name and tag.

License

Apache-2.0 © Intesys Srl