1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.io.build;
18
19 import static org.junit.jupiter.api.Assertions.assertThrows;
20
21 import java.io.IOException;
22 import java.nio.file.Files;
23 import java.nio.file.Paths;
24
25 import org.apache.commons.io.build.AbstractOrigin.ByteArrayOrigin;
26 import org.junit.jupiter.api.BeforeEach;
27 import org.junit.jupiter.api.Test;
28
29
30
31
32
33
34 public class ByteArrayOriginTest extends AbstractOriginTest<byte[], ByteArrayOrigin> {
35
36 @BeforeEach
37 public void beforeEach() throws IOException {
38 setOriginRo(new ByteArrayOrigin(Files.readAllBytes(Paths.get(FILE_NAME_RO))));
39 setOriginRw(new ByteArrayOrigin(new byte[] { 1 }));
40 }
41
42 @Override
43 @Test
44 public void testGetFile() {
45
46 assertThrows(UnsupportedOperationException.class, super::testGetFile);
47 }
48
49 @Override
50 @Test
51 public void testGetOutputStream() {
52
53 assertThrows(UnsupportedOperationException.class, super::testGetOutputStream);
54 }
55
56 @Override
57 @Test
58 public void testGetPath() {
59
60 assertThrows(UnsupportedOperationException.class, super::testGetPath);
61 }
62
63 @Override
64 @Test
65 public void testGetWriter() {
66
67 assertThrows(UnsupportedOperationException.class, super::testGetWriter);
68 }
69
70 }