Created
December 14, 2017 22:36
-
-
Save LenarBad/de2a55c6d88e79ea892658630ef24c76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class TestData extends FileReader { | |
@Value("${testData.users.file}") | |
private String usersFile; | |
public List<User> getUsers() { | |
Gson gson = new Gson(); | |
return Arrays.asList(gson.fromJson(getFileAsString(usersFile), User[].class)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to get test data from external file with Spring