-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a90595e
commit 67d6784
Showing
14 changed files
with
106 additions
and
132 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,12 @@ | ||
package app; | ||
|
||
import app.todoclient.TodoClient; | ||
import app.userclient.UserClient; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
import org.springframework.web.reactive.function.client.support.WebClientAdapter; | ||
import org.springframework.web.service.invoker.HttpServiceProxyFactory; | ||
|
||
@SpringBootApplication | ||
public class App { | ||
|
||
public static void main(String[] args) { | ||
public static void main(final String[] args) { | ||
SpringApplication.run(App.class, args); | ||
} | ||
|
||
@Bean | ||
UserClient userClient(WebClient.Builder builder, @Value("${user-client.url}") String url) { | ||
WebClient webClient = builder.baseUrl(url).build(); | ||
|
||
HttpServiceProxyFactory httpServiceProxyFactory = | ||
HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); | ||
return httpServiceProxyFactory.createClient(UserClient.class); | ||
} | ||
|
||
@Bean | ||
TodoClient todoClient(WebClient.Builder builder, @Value("${todo-client.url}") String url) | ||
throws InterruptedException { | ||
Thread.sleep(1000); | ||
WebClient webClient = builder.baseUrl(url).build(); | ||
|
||
HttpServiceProxyFactory httpServiceProxyFactory = | ||
HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); | ||
return httpServiceProxyFactory.createClient(TodoClient.class); | ||
} | ||
} |
27 changes: 0 additions & 27 deletions
27
wiremock-spring-boot-example/src/main/java/app/controller/TodoController.java
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
wiremock-spring-boot-example/src/main/java/app/controller/TodoDTO.java
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
wiremock-spring-boot-example/src/main/java/app/todoclient/Todo.java
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
wiremock-spring-boot-example/src/main/java/app/todoclient/TodoClient.java
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
wiremock-spring-boot-example/src/main/java/app/userclient/User.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
wiremock-spring-boot-example/src/main/java/app/userclient/UserClient.java
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
wiremock-spring-boot-example/src/main/resources/application.properties
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 |
---|---|---|
@@ -1,4 +1 @@ | ||
user-client.url=https://jsonplaceholder.typicode.com/users | ||
todo-client.url=https://jsonplaceholder.typicode.com/todos | ||
|
||
#logging.level.org.springframework.test.context.cache=DEBUG |
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
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