Skip to content

Commit

Permalink
Updates from the main Helidon repo
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Nesen <[email protected]>
  • Loading branch information
senivam committed Jul 18, 2024
1 parent e4fa338 commit a67ce80
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions examples/microprofile/cors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
<artifactId>helidon-http-media-jsonb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.logging</groupId>
<artifactId>helidon-logging-jul</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
5 changes: 5 additions & 0 deletions examples/microprofile/static-content/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.logging</groupId>
<artifactId>helidon-logging-jul</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void testNotAuthorized(String uri) {
try (Http1ClientResponse response = client.get().uri(uri).request()) {

assertThat(response.status(), is(Status.UNAUTHORIZED_401));
String header = response.headers().get(HeaderNames.WWW_AUTHENTICATE).value();
String header = response.headers().get(HeaderNames.WWW_AUTHENTICATE).get();

assertThat(header.toLowerCase(), containsString("basic"));
assertThat(header, containsString("helidon"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static void main(String[] args) {

Headers headers = response.headers();
for (Header header : headers) {
System.out.println("Header: " + header.name() + "=" + header.value());
System.out.println("Header: " + header.name() + "=" + header.get());
}
System.out.println("Entity:");
System.out.println(response.as(String.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ public static void main(String[] args) {
Config config = Config.create();

WebServerConfig.Builder builder1 = WebServer.builder();
setupConfigBased(builder1, config);
setupConfigBased(builder1, config.get("config-based"));
WebServer server1 = builder1.build().start();
System.out.println("Started config based WebServer on https://localhost:" + server1.port());

WebServerConfig.Builder builder2 = WebServer.builder();
WebServerConfig.Builder builder2 = WebServer.builder()
.config(config.get("builder-based")); // we want port to be configurable always
setupBuilderBased(builder2);
WebServer server2 = builder2.build().start();
System.out.println("Started builder based WebServer on http://localhost:" + server2.port());
Expand All @@ -69,7 +70,8 @@ static void setupBuilderBased(WebServerConfig.Builder server) {
}

static void setupConfigBased(WebServerConfig.Builder server, Config config) {
server.config(config).routing(Main::routing);
server.config(config)
.routing(Main::routing);
}

static void routing(HttpRouting.Builder routing) {
Expand Down

0 comments on commit a67ce80

Please sign in to comment.