Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Rule
- public TemporaryFolder tempFolder = new TemporaryFolder();
- @Before
- public void setup() {
- }
- @Test
- public void getContentFile() throws IOException {
- File textFile = tempFolder.newFile("testText.txt");
- String pathFile = textFile.getPath();
- FileWriter fileWriter = new FileWriter(textFile.getName());
- fileWriter.write("Line1 a");
- fileWriter.write("Line2 b c");
- fileWriter.write("Line3 3");
- String[] testedContent = contentFileRetriever.getContentFile(pathFile);
- String[] expected = {"Line1 a", "Line2 b c", "Line 3"};
- assertArrayEquals(expected, testedContent);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement