Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Windows] Make TrustedHostClientRegistrationPolicyTest Robust to Canonical Hostname localhost #42794

@Pepo48

Description

@Pepo48

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

testsuite

Describe the bug

Thee canonical hostname for 127.0.0.1 can vary depending on the OS, which caused TrustedHostClientRegistrationPolicyTest to fail on Windows:

Error:  org.keycloak.services.clientregistration.policy.impl.TrustedHostClientRegistrationPolicyTest.testLocalhostDomain -- Time elapsed: 0.031 s <<< FAILURE!
java.lang.AssertionError
	at org.junit.Assert.fail(Assert.java:87)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.junit.Assert.assertTrue(Assert.java:53)
	at org.keycloak.services.clientregistration.policy.impl.TrustedHostClientRegistrationPolicyTest.testLocalhostDomain(TrustedHostClientRegistrationPolicyTest.java:70)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)

Version

nightly

Regression

  • The issue is a regression

Expected behavior

All tests passing.

Actual behavior

The test fails

How to Reproduce?

Run the test on Windows

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions