Skip to content

Commit

Permalink
Fix Bean Param Enum Imports (#187)
Browse files Browse the repository at this point in the history
* fix collection imports

* move multi test

* Update pom.xml

* fix bean param enum import

* Update HelloControllerTest.java

* Update GetBeanForm.java

* Update pom.xml
  • Loading branch information
SentryMan authored Mar 19, 2023
1 parent a8a2ad7 commit 040f319
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 33 deletions.
31 changes: 1 addition & 30 deletions http-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,12 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-inject</artifactId>
<version>8.13</version>
<version>9.0-RC3</version>
<optional>true</optional>
</dependency>

<!-- test dependencies -->

<!-- <dependency>-->
<!-- <groupId>io.avaje</groupId>-->
<!-- <artifactId>avaje-slf4j-jpl</artifactId>-->
<!-- <version>1.1</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-applog-slf4j</artifactId>
Expand Down Expand Up @@ -97,15 +90,6 @@
<version>1.1</version>
<scope>test</scope>
</dependency>

<!-- test annotation processors -->
<!-- <dependency>-->
<!-- <groupId>io.avaje</groupId>-->
<!-- <artifactId>avaje-inject-generator</artifactId>-->
<!-- <version>8.6</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

</dependencies>

<build>
Expand Down Expand Up @@ -134,19 +118,6 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
<!-- <configuration>-->
<!-- <argLine>-->
<!-- &#45;&#45;add-modules com.fasterxml.jackson.databind-->
<!-- &#45;&#45;add-modules io.avaje.jsonb-->
<!-- &#45;&#45;add-opens io.avaje.http.client/io.avaje.http.client=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.webserver=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.github=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.webserver=com.fasterxml.jackson.databind-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.github=com.fasterxml.jackson.databind-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.github=io.avaje.jsonb-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.github=io.avaje.inject-->
<!-- </argLine>-->
<!-- </configuration>-->
</plugin>

</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ TypeHandler initTypeHandler() {
!isCollection && typeOp.filter(t -> t.mainType().startsWith("java.util.Map")).isPresent();

if (mainTypeEnum) {
return TypeMap.enumParamHandler(type);
return TypeMap.enumParamHandler(typeOp.orElseThrow());
} else if (isCollection) {
this.isParamCollection = true;
final var isEnumCollection =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package org.example.myapp.web;

import java.util.List;
import java.util.Set;

import javax.validation.Valid;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import io.avaje.http.api.Header;
import io.avaje.http.api.QueryParam;
import io.avaje.jsonb.Json;

@Json
Expand All @@ -23,8 +25,10 @@ public class GetBeanForm {
private String email;

private List<String> addresses;
@Header
private String head;

@Header private String head;

@QueryParam private Set<ServerType> type;

public String getName() {
return name;
Expand Down Expand Up @@ -67,4 +71,12 @@ public String getHead() {
public void setHead(String head) {
this.head = head;
}

public Set<ServerType> getType() {
return type;
}

public void setType(Set<ServerType> type) {
this.type = type;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ void get_validate_bean_expect422() {
final HttpResponse<String> hres = client.request()
.path("hello/withValidBean")
.queryParam("email", "[email protected]")
.queryParam("type", "PROXY")
.GET()
.asString();

Expand All @@ -253,6 +254,7 @@ void get_validate_bean_expect200() {
.path("hello/withValidBean")
.queryParam("name", "hello")
.queryParam("email", "[email protected]")
.queryParam("type", "PROXY")
.GET()
.asString();

Expand Down

0 comments on commit 040f319

Please sign in to comment.