-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rest Client Reactive - fixed @RegisterProvider support
- Loading branch information
1 parent
65b8819
commit 0557762
Showing
13 changed files
with
194 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
.../src/main/java/io/quarkus/rest/client/reactive/runtime/AnnotationRegisteredProviders.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.quarkus.rest.client.reactive.runtime; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public abstract class AnnotationRegisteredProviders { | ||
private final Map<String, Map<Class<?>, Integer>> providers = new HashMap<>(); | ||
|
||
public Map<Class<?>, Integer> getProviders(Class<?> clientClass) { | ||
Map<Class<?>, Integer> providersForClass = providers.get(clientClass.getName()); | ||
return providersForClass == null ? Collections.emptyMap() : providersForClass; | ||
} | ||
|
||
// used by generated code | ||
public void addProviders(String className, Map<Class<?>, Integer> providersForClass) { | ||
this.providers.put(className, providersForClass); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...java/io/quarkus/it/rest/client/Apple.java → ...io/quarkus/it/rest/client/main/Apple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...e-rest-client/src/main/java/io/quarkus/it/rest/client/main/ClientWithExceptionMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.it.rest.client.main; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
|
||
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
import io.quarkus.it.rest.client.main.MyResponseExceptionMapper.MyException; | ||
|
||
@Path("/unprocessable") | ||
@RegisterProvider(MyResponseExceptionMapper.class) | ||
@RegisterRestClient(configKey = "w-exception-mapper") | ||
public interface ClientWithExceptionMapper { | ||
@GET | ||
String get() throws MyException; | ||
} |
2 changes: 1 addition & 1 deletion
2
...it/rest/client/DefaultCtorTestFilter.java → ...st/client/main/DefaultCtorTestFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.