From 15535cf0cfd99f2dc7b5b173d2f69893ef892ae9 Mon Sep 17 00:00:00 2001 From: Tyrell Flurry Date: Fri, 29 May 2020 18:23:01 -0400 Subject: [PATCH] BAEL-4088: clean-up. --- spring-multipart-file/pom.xml | 9 +++++++-- .../file/ConvertMultipartFileExample.java | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/spring-multipart-file/pom.xml b/spring-multipart-file/pom.xml index 7b9eafeda5..a0b9cdfdce 100644 --- a/spring-multipart-file/pom.xml +++ b/spring-multipart-file/pom.xml @@ -14,6 +14,11 @@ ../parent-spring-5 + + 4.12 + 2.0.8 + + org.springframework @@ -23,13 +28,13 @@ org.springframework spring-mock - 2.0.8 + ${org.springframework.spring-mock.version} test junit junit - 4.12 + ${junit.version} test diff --git a/spring-multipart-file/src/test/java/com/baeldung/multipart/file/ConvertMultipartFileExample.java b/spring-multipart-file/src/test/java/com/baeldung/multipart/file/ConvertMultipartFileExample.java index 101e234921..2b4b2bd842 100644 --- a/spring-multipart-file/src/test/java/com/baeldung/multipart/file/ConvertMultipartFileExample.java +++ b/spring-multipart-file/src/test/java/com/baeldung/multipart/file/ConvertMultipartFileExample.java @@ -12,6 +12,11 @@ import org.springframework.web.multipart.MultipartFile; public class ConvertMultipartFileExample { + /** + * Example of converting a {@link MultipartFile} to a {@link File} using {@link MultipartFile#getBytes()}. + * + * @throws IOException + */ @Test public void whenGetBytes_thenOK() throws IOException { MultipartFile multipartFile = new MockMultipartFile("sourceFile.tmp", "Hello World".getBytes()); @@ -25,6 +30,11 @@ public class ConvertMultipartFileExample { os.close(); } + /** + * Example of converting a {@link MultipartFile} to a {@link File} using {@link MultipartFile#getInputStream()}. + * + * @throws IOException + */ @Test public void whenGetInputStream_thenOK() throws IOException { MultipartFile multipartFile = new MockMultipartFile("sourceFile.tmp", "Hello World".getBytes()); @@ -40,6 +50,11 @@ public class ConvertMultipartFileExample { outStream.close(); } + /** + * Example of converting a {@link MultipartFile} to a {@link File} using {@link MultipartFile#transferTo(File)}. + * + * @throws IOException + */ @Test public void whenTransferTo_thenOK() throws IllegalStateException, IOException { MultipartFile multipartFile = new MockMultipartFile("sourceFile.tmp", "Hello World".getBytes());