Skip to content

Commit

Permalink
Fix application yaml test and some unused import (helidon-io#7860)
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin authored Oct 19, 2023
1 parent e4e9c4c commit e753a14
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 67 deletions.
17 changes: 17 additions & 0 deletions applications/se/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@
<name>Helidon SE applications parent pom</name>
<description>Parent pom for Helidon SE applications</description>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.plugin.surefire}</version>
<configuration>
<systemPropertyVariables>
<helidon.config.profile>test</helidon.config.profile>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>native-image</id>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/helidon/src/main/archetype/common/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<includes>
<include>.helidon.mustache</include>
<include>README.md.mustache</include>
<include>src/main/java/**/Main.java.mustache</include>
<include if="${flavor} == 'se'">src/main/java/**/Main.java.mustache</include>
</includes>
</templates>
<model>
Expand Down
4 changes: 1 addition & 3 deletions archetypes/helidon/src/main/archetype/common/extra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,7 @@ restrictive-cors:
<value>io.helidon.http.HeaderNames.ACCESS_CONTROL_ALLOW_ORIGIN</value>
<value>io.helidon.http.HeaderNames.HOST</value>
<value>io.helidon.http.HeaderNames.ORIGIN</value>
</list>
<list key="MainTest-static-imports">
<value if="${flavor} == 'se'">org.hamcrest.CoreMatchers.containsString</value>
<value>org.hamcrest.CoreMatchers.containsString</value>
</list>
<list key="Abstract-tests" if="${flavor} == 'se'">
<value><![CDATA[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
- abac:
# prepares environment
# executes attribute validations
# validates that attributes were processed
# grants/denies access to resource
#
####
# Combinations:
# # Will fail if any attribute is not validated and if any has failed validation
# fail-on-unvalidated: true
# fail-if-none-validated: true
#
# # Will fail if there is one or more attributes present and NONE of them is validated or if any has failed validation
# # Will NOT fail if there is at least one validated attribute and any number of not validated attributes (and NONE failed)
# fail-on-unvalidated: false
# fail-if-none-validated: true
#
# # Will fail if there is any attribute that failed validation
# # Will NOT fail if there are no failed validation or if there are NONE validated
# fail-on-unvalidated: false
# fail-if-none-validated: false
####
# fail if an attribute was not validated (e.g. we do not know, whether it is valid or not)
# defaults to true
fail-on-unvalidated: true
# fail if none of the attributes were validated
# defaults to true
fail-if-none-validated: true
# policy-validator:
# validators:
# - class: "io.helidon.security.abac.policy.DefaultPolicyValidator"
# my-custom-policy-engine:
# some-key: "some value"
# another-key: "another value"
- abac:
# prepares environment
# executes attribute validations
# validates that attributes were processed
# grants/denies access to resource
#
####
# Combinations:
# # Will fail if any attribute is not validated and if any has failed validation
# fail-on-unvalidated: true
# fail-if-none-validated: true
#
# # Will fail if there is one or more attributes present and NONE of them is validated or if any has failed validation
# # Will NOT fail if there is at least one validated attribute and any number of not validated attributes (and NONE failed)
# fail-on-unvalidated: false
# fail-if-none-validated: true
#
# # Will fail if there is any attribute that failed validation
# # Will NOT fail if there are no failed validation or if there are NONE validated
# fail-on-unvalidated: false
# fail-if-none-validated: false
####
# fail if an attribute was not validated (e.g. we do not know, whether it is valid or not)
# defaults to true
fail-on-unvalidated: true
# fail if none of the attributes were validated
# defaults to true
fail-if-none-validated: true
# policy-validator:
# validators:
# - class: "io.helidon.security.abac.policy.DefaultPolicyValidator"
# my-custom-policy-engine:
# some-key: "some value"
# another-key: "another value"
1 change: 0 additions & 1 deletion archetypes/helidon/src/main/archetype/common/media.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
<value>jersey.media.multipart</value>
</list>
<list key="Main-helidon-imports" if="${flavor} == 'se'">
<value>io.helidon.http.Header</value>
<value>io.helidon.http.Status</value>
<value>io.helidon.http.HeaderNames</value>
<value>io.helidon.http.HeaderValues</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
optional="true">
<output>
<model>
<list key="Main-helidon-imports" if="${flavor} == 'se'">
<value>io.helidon.webserver.observe.ObserveFeature</value>
</list>
<list key="dependencies">
<map if="${flavor} == 'se'">
<value key="groupId">io.helidon.webserver.observe</value>
Expand Down
1 change: 1 addition & 0 deletions archetypes/helidon/src/main/archetype/common/packaging.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ kubectl delete -f app.yaml
<directory>files</directory>
<includes>
<include>src/main/java/**/module-info.java.mustache</include>
<include if="${flavor} == 'mp'">src/main/java/**/Main.java.mustache</include>
</includes>
</templates>
</output>
Expand Down
1 change: 0 additions & 1 deletion archetypes/helidon/src/main/archetype/common/security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
<value>io.helidon.security.Security</value>
<value>io.helidon.security.SecurityContext</value>
<value>io.helidon.security.Subject</value>
<value>io.helidon.webserver.security.SecurityFeature</value>
<value>io.helidon.security.providers.oidc.OidcFeature</value>
</list>
<list key="Main-main" if="${flavor} == 'se'">
Expand Down
2 changes: 0 additions & 2 deletions archetypes/helidon/src/main/archetype/mp/common/common-mp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
<value>io.helidon.microprofile.testing.junit5.HelidonTest</value>
</list>
<list key="MainTest-other-imports">
<value>org.junit.jupiter.api.AfterAll</value>
<value>org.junit.jupiter.api.BeforeAll</value>
<value>org.junit.jupiter.api.Test</value>
</list>
<list key="MainTest-static-imports">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
</list>
<list key="MainTest-helidon-imports">
<value>io.helidon.http.Status</value>
<value>io.helidon.config.Config</value>
<value>io.helidon.webserver.testing.junit5.SetUpRoute</value>
<value>io.helidon.webclient.http1.Http1Client</value>
<value>io.helidon.webclient.http1.Http1ClientResponse</value>
Expand Down
6 changes: 0 additions & 6 deletions archetypes/helidon/src/main/archetype/se/custom/database.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ For details on an Oracle Docker image, see https://github.com/oracle/docker-imag
<value>io.helidon.dbclient.DbStatementType</value>
<value>io.helidon.dbclient.metrics.DbClientMetrics</value>
<value>io.helidon.dbclient.tracing.DbClientTracing</value>
<value>io.helidon.webserver.observe.ObserveFeature</value>
<value>io.helidon.tracing.Tracer</value>
<value>io.helidon.tracing.TracerBuilder</value>
</list>
<list key="Main-routing">
<value><![CDATA[
Expand Down Expand Up @@ -335,9 +332,6 @@ docker run --rm --name mongo -p 27017:27017 mongo
</list>
<list key="Main-helidon-imports" if="${server} != 'mongo'">
<value>io.helidon.dbclient.DbClient</value>
<value>io.helidon.webserver.observe.ObserveFeature</value>
<value>io.helidon.tracing.Tracer</value>
<value>io.helidon.tracing.TracerBuilder</value>
</list>
<list key="Main-routing-builder" if="${server} != 'mongodb'">
<value><![CDATA[.register("/db", new PokemonService(DbClient.create(config.get("db"))))]]></value>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
package {{package}};

import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;

import io.helidon.config.Config;
import io.helidon.config.ConfigValue;
import io.helidon.webclient.http1.Http1Client;
import io.helidon.webclient.http1.Http1ClientResponse;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ tracing:
<value key="artifactId">helidon-webserver-http2</value>
</map>
</list>
<list key="Main-helidon-imports" if="${health}">
<value>io.helidon.health.checks.DeadlockHealthCheck</value>
<value>io.helidon.health.checks.DiskSpaceHealthCheck</value>
<value>io.helidon.health.checks.HeapMemoryHealthCheck</value>
<value>io.helidon.webserver.observe.health.HealthObserver</value>
</list>
<list key="Main-helidon-imports" if="${tracing}">
<value>io.helidon.webserver.http2.Http2Route</value>
<value>io.helidon.webserver.http.Handler</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import io.helidon.dbclient.DbMapper;
import io.helidon.dbclient.DbRow;

/**
* Maps database statements to {@link io.helidon.examples.dbclient.common.Pokemon} class.
* Maps database statements to {@link {{package}}.Pokemon} class.
*/
public class PokemonMapper implements DbMapper<Pokemon> {
Expand Down

0 comments on commit e753a14

Please sign in to comment.