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

Fixed bug with DefaultServiceInstance: getScheme() was not implemented #926

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dagerber
Copy link
Contributor

This fixes the problem, that a https URI could not be overriden in Unit tests with http (avoiding certificate problems on the build server)

Copy link
Collaborator

@OlgaMaciaszek OlgaMaciaszek left a comment

Choose a reason for hiding this comment

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

@dagerber Thanks for submitting this. In general, it looks good, however, have added some comments to address. Also, please add your name with the @author tag in the classes you've changed.
Since this issue is also present in the Hoxton release train, please submit this PR against the 2.2.x branch instead (either edit this PR or create a new one).

@@ -173,4 +173,9 @@ public int hashCode() {
return Objects.hash(instanceId, serviceId, host, port, secure, metadata);
}

@Override
public String getScheme() {
return this.isSecure() ? "https" : "http";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove unnecessary this. keyword.

@@ -173,4 +173,9 @@ public int hashCode() {
return Objects.hash(instanceId, serviceId, host, port, secure, metadata);
}

@Override
public String getScheme() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please reuse this method in getUri(ServiceInstance instance).


@Test
public void testGetANonExistentServiceShouldReturnAnEmptyList() {
then(this.discoveryClient.description()).isEqualTo("Simple Reactive Discovery Client");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove the use of unnecessary this. keywords in tests.

@@ -0,0 +1,102 @@
/*
* Copyright 2012-2020 the original author or authors.
Copy link
Collaborator

Choose a reason for hiding this comment

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

2012-2021

@OlgaMaciaszek
Copy link
Collaborator

Fixes gh-823.

@OlgaMaciaszek OlgaMaciaszek linked an issue Mar 16, 2021 that may be closed by this pull request
@OlgaMaciaszek OlgaMaciaszek self-assigned this Mar 16, 2021
This fixes the problem, that a https URI could not be overriden in Unit tests with http (avoiding certificate problems on the build server)
@OlgaMaciaszek
Copy link
Collaborator

@dagerber since we are doing a release today, I'm going to cherry-pick your commits, add the changes from the comments and merge it already.

@dagerber
Copy link
Contributor Author

dagerber commented Mar 16, 2021 via email

@OlgaMaciaszek
Copy link
Collaborator

Ok, @dagerber. Please change it then and submit against 2.2.x.

@dagerber
Copy link
Contributor Author

dagerber commented Mar 16, 2021 via email

@spencergibb
Copy link
Member

@dagerber you needed to do a force push as now there are unrelated commits here.

@dagerber
Copy link
Contributor Author

dagerber commented Mar 16, 2021 via email

@spencergibb
Copy link
Member

Indeed, thanks, that's better.

@spencergibb
Copy link
Member

cherry picked to 2.2.x and merged forward via 4269bb3

@spencergibb
Copy link
Member

reverted. see #823 (comment)

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.

SimpleServcieInstance should override getScheme()
4 participants