Simplify InputStream assertions

See gh-23052
This commit is contained in:
dreis2211
2020-08-23 13:28:46 +02:00
committed by Stephane Nicoll
parent 5b1c484e0d
commit 33cd875cb8
4 changed files with 15 additions and 24 deletions

View File

@@ -29,8 +29,6 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.springframework.util.StreamUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
@@ -77,8 +75,7 @@ class ZipFileTarArchiveTests {
assertThat(fileEntry.getLongUserId()).isEqualTo(123);
assertThat(fileEntry.getLongGroupId()).isEqualTo(456);
assertThat(fileEntry.getSize()).isEqualTo(4);
String fileContent = StreamUtils.copyToString(tarStream, StandardCharsets.UTF_8);
assertThat(fileContent).isEqualTo("test");
assertThat(tarStream).hasContent("test");
}
}