Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds description for JUnit 5 usage #911

Merged
merged 2 commits into from
Oct 15, 2018
Merged

Conversation

artjomka
Copy link
Contributor

Adds separate section in usage documentation to address differences in JUnit4/JUnit5 approaches.

docs/usage.md Outdated

### JUnit 5

**JUnit5**: you need to manually start container in *@BeforeAll* annotated method in test (tear down happens automatically on test end)
Copy link
Member

@bsideup bsideup Oct 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this example does not reflect the previous one, with JUnit 4. Maybe we should replace it with @BeforeEach/@AfterEach

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or alternatively, use @ClassRule in the JUnit4 example.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please uppercase You and . at the end of the sentence.
You need to manually start the container in a *@BeforeAll* annotated method in your test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the tear down happen on JVM exit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, will adjust it

Copy link
Member

@kiview kiview left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, I've added some small remarks.

docs/usage.md Outdated

### Junit 4

**JUnit4 @Rule/@ClassRule**: this mode starts container before your tests and tears it down afterwards.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this with uppercase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That part was copied from database_container.md - should I also adjust it there too ?

docs/usage.md Outdated

**JUnit5**: you need to manually start container in *@BeforeAll* annotated method in test (tear down happens automatically on test end)

Start container in @BeforeAll method:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Start container in a method annotated with @BeforeAll:

docs/usage.md Outdated

### JUnit 5

**JUnit5**: you need to manually start container in *@BeforeAll* annotated method in test (tear down happens automatically on test end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or alternatively, use @ClassRule in the JUnit4 example.

docs/usage.md Outdated

### JUnit 5

**JUnit5**: you need to manually start container in *@BeforeAll* annotated method in test (tear down happens automatically on test end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please uppercase You and . at the end of the sentence.
You need to manually start the container in a *@BeforeAll* annotated method in your test

docs/usage.md Outdated

### JUnit 5

**JUnit5**: you need to manually start container in *@BeforeAll* annotated method in test (tear down happens automatically on test end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the tear down happen on JVM exit.

@kiview kiview merged commit 21284b4 into testcontainers:master Oct 15, 2018
@kiview
Copy link
Member

kiview commented Oct 15, 2018

@artjomka Thanks for your contribution.
I've merge the PR and will some tiny changes for grammar in a follow up commit.

@kiview kiview added this to the next milestone Oct 15, 2018
@kiview kiview mentioned this pull request Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants