-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding common Testcontainers Guide template content
- Loading branch information
1 parent
0e8e380
commit afc299f
Showing
3 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
= GUIDE_TITLE | ||
|
||
This is sample code for [GUIDE_TITLE](https://testcontainers.com/guides/GUIDE_URL) Guide. | ||
|
||
== 1. Setup Environment | ||
Make sure you have a [compatible Docker environment](https://www.testcontainers.org/supported_docker_environment/) installed. | ||
|
||
For example: | ||
|
||
[source,shell] | ||
---- | ||
$ docker version | ||
... | ||
Server: Docker Desktop 4.12.0 (85629) | ||
Engine: | ||
Version: 20.10.17 | ||
API version: 1.41 (minimum version 1.12) | ||
Go version: go1.17.11 | ||
... | ||
---- | ||
|
||
* Add language specific prerequisites here | ||
|
||
[source,shell] | ||
---- | ||
$ java -version | ||
openjdk version "17.0.4" 2022-07-19 | ||
OpenJDK Runtime Environment Temurin-17.0.4+8 (build 17.0.4+8) | ||
OpenJDK 64-Bit Server VM Temurin-17.0.4+8 (build 17.0.4+8, mixed mode, sharing) | ||
---- | ||
|
||
== 2. Setup Project | ||
|
||
* Clone the repository | ||
[source,shell] | ||
---- | ||
git clone https://github.com/testcontainers/TC_GUIDE_REPO_NAME.git | ||
cd TC_GUIDE_REPO_NAME | ||
---- | ||
* Open the **TC_GUIDE_REPO_NAME** project in your favorite IDE. | ||
|
||
== 3. Run Tests | ||
|
||
Run the command to run the tests. | ||
|
||
[source,shell] | ||
---- | ||
$ ./gradlew test //for Gradle | ||
$ ./mvnw verify //for Maven | ||
$ go test ./... //for Go | ||
$ npm test //for Node | ||
---- | ||
|
||
The tests should pass. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
title: "GUIDE_TITLE" | ||
date: 2023-03-07T09:39:58+05:30 | ||
draft: false | ||
description: GUIDE_SHORT_DESCRIPTION | ||
repo: https://github.com/testcontainers/TC_GUIDE_REPO_NAME | ||
languages: | ||
- Java | ||
tags: | ||
- spring-boot | ||
- postgresql | ||
--- | ||
:toc: | ||
:toclevels: 2 | ||
:codebase: https://raw.githubusercontent.com/testcontainers/TC_GUIDE_REPO_NAME/main | ||
|
||
In this guide you will learn how to | ||
|
||
* Perform task 1 | ||
* Perform task 2 | ||
|
||
== Prerequisites | ||
* Java 17+ / Go 1.20+ / Node 16.x etc | ||
* Your favorite IDE (Intellij IDEA, Eclipse, NetBeans, VS Code) | ||
* A Docker environment supported by Testcontainers https://www.testcontainers.org/supported_docker_environment/ | ||
|
||
== What we are going to achieve in this guide | ||
|
||
Summary of what we are going to implement and learn in one or two paragraphs. | ||
|
||
== Getting Started | ||
Explain how to create a new project with your favourite build tool support. | ||
|
||
Here is how you can include an inline code block: | ||
|
||
[source,java] | ||
---- | ||
class Hello { | ||
void method1() { | ||
System.out.println("Hello"); | ||
} | ||
} | ||
---- | ||
|
||
== Step 1 | ||
|
||
Here is how you can include entire file from sample code: | ||
|
||
[source,sql] | ||
---- | ||
include::{codebase}/src/test/resources/init-db.sql[] | ||
---- | ||
|
||
[WARNING] | ||
A warning message here. | ||
|
||
== Step 2 | ||
|
||
Here is how you can include specific lines of code segments from sample code: | ||
|
||
[source,java] | ||
---- | ||
include::{codebase}/src/test/java/com/testcontainers/demo/LocalStackTest.java[lines="23..48,55..76"] | ||
---- | ||
|
||
[NOTE] | ||
An important note here. | ||
|
||
== Summary | ||
Summary of what we have learned and add call-to-action. | ||
|
||
To learn more about Testcontainers visit http://testcontainers.com | ||
|
||
== Further Reading | ||
* https://testcontainers.com/guides/introducing-testcontainers/ | ||
* https://www.testcontainers.org/quickstart/junit_5_quickstart/ |