Skip to content

Commit 3cb5be0

Browse files
committed
Squashable commit; addressing PR feedback
Signed-off-by: Laird Nelson <[email protected]>
1 parent 1e5d566 commit 3cb5be0

File tree

11 files changed

+67
-47
lines changed

11 files changed

+67
-47
lines changed

webclient/discovery/pom.xml

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,53 @@
2929

3030
<properties>
3131
<java.util.logging.config.file>src/test/resources/logging.properties</java.util.logging.config.file>
32+
<javadoc.fail-on-warnings>true</javadoc.fail-on-warnings>
3233
<spotbugs.exclude>etc/spotbugs/exclude.xml</spotbugs.exclude>
3334
</properties>
3435

3536
<dependencies>
37+
38+
<!-- Directly-used compile-scoped dependencies. -->
3639
<dependency>
3740
<groupId>io.helidon.builder</groupId>
3841
<artifactId>helidon-builder-api</artifactId>
3942
</dependency>
43+
<dependency>
44+
<groupId>io.helidon.common</groupId>
45+
<artifactId>helidon-common-config</artifactId>
46+
</dependency>
47+
<dependency>
48+
<groupId>io.helidon.common</groupId>
49+
<artifactId>helidon-common-uri</artifactId>
50+
</dependency>
51+
<dependency>
52+
<groupId>io.helidon.discovery</groupId>
53+
<artifactId>helidon-discovery</artifactId>
54+
</dependency>
4055
<dependency>
4156
<groupId>io.helidon.webclient</groupId>
4257
<artifactId>helidon-webclient-api</artifactId>
4358
</dependency>
59+
60+
<!-- Compile-scoped dependencies required by usage of Helidon Builder in generated code, etc. -->
4461
<dependency>
4562
<groupId>io.helidon.common</groupId>
4663
<artifactId>helidon-common</artifactId>
4764
</dependency>
4865
<dependency>
49-
<groupId>io.helidon.config</groupId>
50-
<artifactId>helidon-config</artifactId>
51-
</dependency>
52-
<dependency>
53-
<groupId>io.helidon.discovery</groupId>
54-
<artifactId>helidon-discovery</artifactId>
66+
<groupId>io.helidon.common</groupId>
67+
<artifactId>helidon-common-types</artifactId>
5568
</dependency>
5669
<dependency>
57-
<groupId>io.helidon.http</groupId>
58-
<artifactId>helidon-http</artifactId>
70+
<groupId>io.helidon.config</groupId>
71+
<artifactId>helidon-config</artifactId>
5972
</dependency>
6073
<dependency>
6174
<groupId>io.helidon.service</groupId>
6275
<artifactId>helidon-service-registry</artifactId>
6376
</dependency>
6477

78+
<!-- Test-scoped dependencies. -->
6579
<dependency>
6680
<groupId>io.helidon.config</groupId>
6781
<artifactId>helidon-config-yaml</artifactId>
@@ -73,13 +87,13 @@
7387
<scope>test</scope>
7488
</dependency>
7589
<dependency>
76-
<groupId>org.junit.jupiter</groupId>
77-
<artifactId>junit-jupiter-api</artifactId>
90+
<groupId>org.hamcrest</groupId>
91+
<artifactId>hamcrest-all</artifactId>
7892
<scope>test</scope>
7993
</dependency>
8094
<dependency>
81-
<groupId>org.hamcrest</groupId>
82-
<artifactId>hamcrest-all</artifactId>
95+
<groupId>org.junit.jupiter</groupId>
96+
<artifactId>junit-jupiter-api</artifactId>
8397
<scope>test</scope>
8498
</dependency>
8599
</dependencies>
@@ -122,6 +136,9 @@
122136
<version>${helidon.version}</version>
123137
</path>
124138
</annotationProcessorPaths>
139+
<compilerArgs>
140+
<arg>-Xlint:all</arg>
141+
</compilerArgs>
125142
</configuration>
126143
<dependencies>
127144
<dependency>
@@ -151,6 +168,20 @@
151168
</dependency>
152169
</dependencies>
153170
</plugin>
171+
<plugin>
172+
<groupId>org.apache.maven.plugins</groupId>
173+
<artifactId>maven-dependency-plugin</artifactId>
174+
<executions>
175+
<execution>
176+
<id>check-dependencies</id>
177+
<phase>verify</phase>
178+
<configuration>
179+
<ignoredNonTestScopedDependencies>io.helidon.common:helidon-common-parameters</ignoredNonTestScopedDependencies>
180+
<ignoredUsedUndeclaredDependencies>io.helidon.common:helidon-common-parameters</ignoredUsedUndeclaredDependencies>
181+
</configuration>
182+
</execution>
183+
</executions>
184+
</plugin>
154185
<plugin>
155186
<artifactId>maven-surefire-plugin</artifactId>
156187
<configuration>

webclient/discovery/src/main/java/io/helidon/webclient/discovery/DefaultWebClientDiscovery.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ public WebClientDiscoveryConfig prototype() {
9898
public WebClientServiceResponse handle(Chain chain, WebClientServiceRequest request) {
9999
ClientUri clientUri = request.uri();
100100
if (LOGGER.isLoggable(DEBUG)) {
101-
LOGGER.log(DEBUG, "Initial ClientUri: " + clientUri);
102-
LOGGER.log(DEBUG, "Properties: " + request.properties());
101+
LOGGER.log(DEBUG, "Initial ClientUri: " + clientUri + "; properties: " + request.properties());
103102
}
104103

105104
DiscoveryRequest discoveryRequest = DiscoveryRequest.of(request.properties(), request.uri()).orElse(null);

webclient/discovery/src/main/java/io/helidon/webclient/discovery/WebClientDiscoveryProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ public String configKey() {
5555
* java.net.URI) discover} URIs.
5656
*
5757
* @param config a {@link Config}
58-
* @param name a service name; normally {@code discovery}; ignored
58+
* @param name a service name; normally {@code discovery}
5959
* @return a new, non-{@code null} {@link WebClientDiscovery} implementation enabling discovery for its affiliated
6060
* {@link io.helidon.webclient.api.WebClient} instance
61-
* @exception NullPointerException if {@code config} is {@code null}
61+
* @exception NullPointerException if {@code config} or {@code name} is {@code null}
6262
* @see WebClientDiscovery#handle(io.helidon.webclient.spi.WebClientService.Chain,
6363
* io.helidon.webclient.api.WebClientServiceRequest)
6464
* @see WebClientDiscoveryConfig#builder()
@@ -68,6 +68,7 @@ public String configKey() {
6868
public WebClientDiscovery create(Config config, String name) {
6969
return WebClientDiscoveryConfig.builder()
7070
.config(config)
71+
.name(name) // after config(config) so that the name argument is always honored
7172
.build();
7273
}
7374

webclient/discovery/src/main/java/module-info.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,8 @@
2222
*/
2323
module io.helidon.webclient.discovery {
2424

25-
requires io.helidon.webclient.api;
26-
27-
requires io.helidon.builder.api;
28-
29-
requires io.helidon.common;
30-
31-
requires io.helidon.config;
32-
33-
requires io.helidon.discovery;
34-
35-
requires io.helidon.http;
36-
37-
requires io.helidon.service.registry;
38-
25+
requires transitive io.helidon.discovery;
26+
requires transitive io.helidon.webclient.api;
3927
exports io.helidon.webclient.discovery;
4028

4129
provides io.helidon.webclient.spi.WebClientServiceProvider

webclient/discovery/src/test/java/io/helidon/webclient/discovery/TestClientUri.java renamed to webclient/discovery/src/test/java/io/helidon/webclient/discovery/ClientUriTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
import static org.hamcrest.Matchers.isEmptyString;
3434
import static org.hamcrest.Matchers.nullValue;
3535

36-
class TestClientUri {
36+
class ClientUriTest {
3737

38-
private TestClientUri() {
38+
private ClientUriTest() {
3939
super();
4040
}
4141

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@
3434
import static java.util.HashMap.newHashMap;
3535
import static java.util.logging.Level.FINER;
3636
import static org.hamcrest.MatcherAssert.assertThat;
37+
import static org.hamcrest.Matchers.containsString;
3738
import static org.hamcrest.Matchers.instanceOf;
3839
import static org.hamcrest.Matchers.is;
3940

40-
class TestDiscoveryRequest {
41+
class DiscoveryRequestTest {
4142

42-
private TestDiscoveryRequest() {
43+
private DiscoveryRequestTest() {
4344
super();
4445
}
4546

4647
@Test
47-
void testDiscoveryRequest() {
48+
void discoveryRequestTest() {
4849
Map<String, String> m = newHashMap(7);
4950
m.put("helidon-discovery-ids", " prod ,, test ");
5051
m.put("helidon-discovery-prod-prefix-uri", "http://example.com/prod/");
@@ -112,7 +113,7 @@ public void publish(LogRecord r) {
112113
l.setLevel(level);
113114
}
114115
// see src/test/resources/application.yaml
115-
assertThat(uris[0], is("http://prod.example.com:80/foo/foo"));
116+
assertThat(uris[0], containsString("http://prod.example.com:80/foo/foo"));
116117
assertThat(uris[1], is("http://prod.example.com:80/foo"));
117118
}
118119

webclient/discovery/src/test/java/io/helidon/webclient/discovery/TestURI.java renamed to webclient/discovery/src/test/java/io/helidon/webclient/discovery/URITest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import static org.hamcrest.Matchers.nullValue;
2626
import static org.hamcrest.Matchers.sameInstance;
2727

28-
class TestURI {
28+
class URITest {
2929

30-
private TestURI() {
30+
private URITest() {
3131
super();
3232
}
3333

webclient/discovery/src/test/java/io/helidon/webclient/discovery/TestUriEncoding.java renamed to webclient/discovery/src/test/java/io/helidon/webclient/discovery/UriEncodingTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import static org.hamcrest.MatcherAssert.assertThat;
2626
import static org.hamcrest.Matchers.is;
2727

28-
class TestUriEncoding {
28+
class UriEncodingTest {
2929

30-
private TestUriEncoding() {
30+
private UriEncodingTest() {
3131
super();
3232
}
3333

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
import static org.hamcrest.Matchers.hasEntry;
3030
import static org.hamcrest.Matchers.is;
3131

32-
class TestWebClientConfig {
32+
class WebClientConfigTest {
3333

34-
private TestWebClientConfig() {
34+
private WebClientConfigTest() {
3535
super();
3636
}
3737

webclient/discovery/src/test/java/io/helidon/webclient/discovery/TestWebClient.java renamed to webclient/discovery/src/test/java/io/helidon/webclient/discovery/WebClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
import static org.junit.jupiter.api.Assertions.assertThrows;
2222

23-
class TestWebClient {
23+
class WebClientTest {
2424

25-
private TestWebClient() {
25+
private WebClientTest() {
2626
super();
2727
}
2828

0 commit comments

Comments
 (0)