Skip to content

Cleanup it tests#36

Merged
tomaszmichalak merged 18 commits intomasterfrom
feature/cleanup-it-tests
Dec 19, 2018
Merged

Cleanup it tests#36
tomaszmichalak merged 18 commits intomasterfrom
feature/cleanup-it-tests

Conversation

@malaskowski
Copy link
Copy Markdown
Member

Description

Fixed #34 .

Motivation and Context

IT tests contained a lot of unnecessary and some tests that made them hard to understand.
Now they are cleaned up.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the Knot.x Contributor License Agreement.

Comment thread knotx-it-tests/src/test/resources/conf/it-tests-application.conf
Comment thread knotx-it-tests/src/test/resources/content/local/customSnippetTag.html Outdated
@tomaszmichalak
Copy link
Copy Markdown
Member

Good job!

.rxSendForm(getMultiMap(formData));

subscribeToResult_shouldSucceed(context, httpResponseSingle, resp -> {
assertEquals(Jsoup.parse(FileReader.readTextSafe(expectedResponseFile)).body().html(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please mark io.knotx.junit.util.FileReader as deprecated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

.rxSendForm(getMultiMap(formData));

subscribeToResult_shouldSucceed(context, httpResponseSingle, resp -> {
assertEquals(Jsoup.parse(FileReader.readTextSafe(expectedResponseFile)).body().html(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we introduce util that would hide Jsoup dependency like:
String HTMLFormatter.get(String input)
String HTMLFormatter.get(URL input)
Then when we decide to change Jsoup to different engine we would not have to fix all tests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea.
However, I will create assertion that checks HTML body.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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


@ExtendWith(KnotxExtension.class)
@TestInstance(Lifecycle.PER_CLASS)
public class SampleApplicationFallbackSupportIntegrationTest {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I really like this class!

@tomaszmichalak tomaszmichalak merged commit 2eadfc8 into master Dec 19, 2018
@tomaszmichalak tomaszmichalak deleted the feature/cleanup-it-tests branch December 19, 2018 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup it-tests

3 participants