Deprecate StreamUtils.emptyInput()

Closes gh-29125
This commit is contained in:
Brian Clozel
2022-09-09 22:43:40 +02:00
parent d4a74c8f9d
commit 0770d86936
14 changed files with 29 additions and 34 deletions

View File

@@ -17,12 +17,12 @@
package org.springframework.scripting.support;
import java.io.IOException;
import java.io.InputStream;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.Resource;
import org.springframework.util.StreamUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;
@@ -60,7 +60,7 @@ public class ResourceScriptSourceTests {
// does not support File-based reading; delegates to InputStream-style reading...
//resource.getFile();
//mock.setThrowable(new FileNotFoundException());
given(resource.getInputStream()).willReturn(StreamUtils.emptyInput());
given(resource.getInputStream()).willReturn(InputStream.nullInputStream());
ResourceScriptSource scriptSource = new ResourceScriptSource(resource);
assertThat(scriptSource.isModified()).as("ResourceScriptSource must start off in the 'isModified' state (it obviously isn't).").isTrue();