Skip to content

Commit

Permalink
[JAVA-40640] Moved article "Upload a File with WebClient" from spring…
Browse files Browse the repository at this point in the history
…-reactive-client to spring-reactive-client-2 (eugenp#17807)
  • Loading branch information
panos-kakos authored Oct 12, 2024
1 parent a37c30a commit a75559a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
1 change: 1 addition & 0 deletions spring-reactive-modules/spring-reactive-client-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Spring WebClient exchange() vs retrieve()](https://www.baeldung.com/spring-webclient-exchange-vs-retrieve)
- [Using Reactor Mono.cache() for Memoization](https://www.baeldung.com/spring-reactor-mono-cache)
- [Comparison Between Flux.map() and Flux.doOnNext()](https://www.baeldung.com/flux-map-vs-doonnext)
- [Upload a File with WebClient](https://www.baeldung.com/spring-webclient-upload-file)
- More articles: [[<-- prev]](../spring-reactive-client)
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.baeldung.reactive.controller;
package com.baeldung.controller;


import com.baeldung.reactive.service.ReactiveUploadService;
import org.springframework.http.HttpStatusCode;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import reactor.core.publisher.Mono;

import com.baeldung.service.ReactiveUploadService;

import reactor.core.publisher.Mono;

@RestController
public class UploadController {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.reactive.exception;
package com.baeldung.exception;

public class ServiceException extends RuntimeException{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.baeldung.reactive.service;
package com.baeldung.service;

import java.net.URI;

import com.baeldung.reactive.exception.ServiceException;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
Expand All @@ -12,9 +12,10 @@
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.util.UriComponentsBuilder;
import reactor.core.publisher.Mono;

import java.net.URI;
import com.baeldung.exception.ServiceException;

import reactor.core.publisher.Mono;

@Service
public class ReactiveUploadService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package com.baeldung.reactive.service;
package com.baeldung.service;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.junit.jupiter.api.Test;
import org.springframework.core.io.Resource;
Expand All @@ -7,11 +11,8 @@
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import reactor.core.publisher.Mono;

class ReactiveUploadServiceUnitTest {

Expand Down
1 change: 0 additions & 1 deletion spring-reactive-modules/spring-reactive-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Simultaneous Spring WebClient Calls](https://www.baeldung.com/spring-webclient-simultaneous-calls)
- [Mocking a WebClient in Spring](https://www.baeldung.com/spring-mocking-webclient)
- [Get List of JSON Objects with WebClient](https://www.baeldung.com/spring-webclient-json-list)
- [Upload a File with WebClient](https://www.baeldung.com/spring-webclient-upload-file)
- [How to Get Response Body When Testing the Status Code in WebFlux WebClient](https://www.baeldung.com/spring-webclient-get-response-body)
- [Spring Boot FeignClient vs. WebClient](https://www.baeldung.com/spring-boot-feignclient-vs-webclient)
- More articles: [[next -->]](../spring-reactive-client-2)

0 comments on commit a75559a

Please sign in to comment.