Skip to content

Commit 3aae55a

Browse files
authored
Merge pull request #259 from avaje/feature/test-profile-nima-filter-chain
Add maven test profile as activeByDefault does not work in this scenario
2 parents 5f30de5 + 120f670 commit 3aae55a

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
env:
3434
JAVA_VERSION: ${{ matrix.java_version }}
3535
run: |
36-
mvn clean package
36+
mvn clean package -Ptest

.github/workflows/jdk-ea.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jobs:
3737
- name: Maven version
3838
run: mvn --version
3939
- name: Build with Maven
40-
run: mvn clean verify package
40+
run: mvn clean verify package -Ptest
4141

pom.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,15 @@
4444
<module>http-generator-javalin</module>
4545
<module>http-generator-jex</module>
4646
<module>http-generator-client</module>
47+
<module>tests</module>
4748
</modules>
4849

4950
<profiles>
5051
<profile>
5152
<id>central</id>
5253
</profile>
5354
<profile>
54-
<id>default</id>
55-
<activation>
56-
<activeByDefault>true</activeByDefault>
57-
</activation>
55+
<id>test</id>
5856
<modules>
5957
<module>tests</module>
6058
</modules>

tests/test-nima-jsonb/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@
6363
<version>1.1</version>
6464
<scope>test</scope>
6565
</dependency>
66+
67+
<dependency>
68+
<groupId>io.avaje</groupId>
69+
<artifactId>avaje-http-helidon-generator</artifactId>
70+
<version>${project.version}</version>
71+
<scope>test</scope>
72+
</dependency>
6673
</dependencies>
6774

6875
<build>

tests/test-nima-jsonb/src/main/java/org/example/TestController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ Map<String, Object> strBody2() {
8686
}
8787

8888
@ExceptionHandler
89-
String exception(Exception ex) {
90-
91-
return "";
89+
String exception(IllegalArgumentException ex) {
90+
return "Err: " + ex;
9291
}
9392

9493
@ExceptionHandler
@@ -105,5 +104,6 @@ void exceptionVoid(ServerResponse res) {
105104
@Filter
106105
void filter(FilterChain chain, RoutingResponse res) {
107106
System.err.println("do nothing lmao");
107+
chain.proceed();
108108
}
109109
}

tests/test-nima-jsonb/src/test/java/org/example/TestPair.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ private static HttpRouting.Builder routing() {
4242

4343
var hc = new HelloController();
4444
var hello = new HelloController$Route(hc, beanValidator, jsonb);
45-
4645
routing.addFeature(hello);
47-
hello.setup(routing);
4846

4947
var cr = new ThreadLocalRequestContextResolver();
5048
var tc = new TestController();

0 commit comments

Comments
 (0)