Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Used as dependency in PowerMock Example
package com.richashworth.powermockexample;
import java.nio.charset.Charset;
import java.util.List;
import static;
public final class DataProvider {
public static List<String> getData() {
List<String> data = null;
try {
data = new DataProvider().readFile();
} catch (IOException e) {
return data;
private static List<String> readFile() throws IOException {
File file = new File("/some/path/to/file");
List<String> lines = readLines(file, Charset.forName("utf-8"));
return lines;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.