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

feat: introduce WireMock for testing #350

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

RehanChalana
Copy link

No description provided.

Copy link
Member

@ascheman ascheman 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 all of the changes.
I would be willing to accept the PR as it is (provided it works as I have not yet checked it), if you don't find the time to beautify according to my comments.

@@ -21,6 +21,9 @@ dependencies {

testImplementation platform("org.codehaus.groovy:groovy-bom:${GroovySystem.version}")
testImplementation 'org.codehaus.groovy:groovy-xml'

testImplementation 'org.wiremock.integrations.testcontainers:wiremock-testcontainers-module:1.0-alpha-14'
testImplementation "org.testcontainers:junit-jupiter:1.20.2"
Copy link
Member

Choose a reason for hiding this comment

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

Could you please put the versions into the gradle/libs.versions.toml file?

import java.lang.reflect.Field
import java.lang.reflect.Proxy


Copy link
Member

Choose a reason for hiding this comment

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

Please do not make more than one new line behind a new block (I know this is not consequently done over all of the repository).

def setup() {
myConfig = new Configuration()
brokenHttpLinksChecker = new BrokenHttpLinksChecker( myConfig )

collector = new SingleCheckResults()
}


/** executed once after all specs are executed **/
def cleanupSpec() {
Copy link
Member

Choose a reason for hiding this comment

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

Just a remark: This should have been part of the previous commit (but I am fine if it stays here).

@@ -131,7 +180,7 @@ class BrokenHttpLinksCheckerSpec extends Specification {
//@Ignore("test currently breaks. see issue-219")
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps you could also remove the comment here?

@ascheman
Copy link
Member

I just see there are some @Ignores left. They could be removed if the test cases work now?

@ascheman
Copy link
Member

Merge post-poned due to PavanMudigonda/jacoco-reporter#68

- Added WireMockContainer to BrokenHttpLinksCheckerSpec for mocking HTTP responses.
- progress towards fixing aim42#331
- Configured WireMock to use mappings.json for predefined request-response mappings.
…mHostNameResolver

- fixes aim42#331
- Updated all URLs in test cases to use WireMock with Testcontainers.
- Integrated CustomHostNameResolver to ensure tests run without internet.
- Updated `mappings.json` with mappings for all test URLs.
- Remove test for recognizing internet connectivity.
Copy link

sonarcloud bot commented Oct 13, 2024

@ascheman ascheman added the hacktoberfest This is a nice ticket for the hacktoberfest label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest This is a nice ticket for the hacktoberfest hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants