How to read src/test/resources/ file in Junit in Spring Boot ?
This is the very short program which explains how to read the xml/propery files presents inside the src/test/resources folder in your spring boot project.
Reading xml file from src/test/resources:
Below code reads the file from src/test/resources/my_sample_xml.xml file content and just prints in the console.
@SpringBootTest
public class XmlPropertyRead{
@Test
public void testXmlAttribute() throws Exception {
Path relPath = Paths.get("src", "test", "resources", "my_sample_xml.xml");
String content = null;
try {
content =Files.lines(relPath).collect(Collectors.joining(System.lineSeparator()));
System.out.println(content);
} catch (IOException e) {
e.printStackTrace();
}
assertTrue(true);
}
}
I’ve heard some good things about wagipluss. Anyone tried it? Looks promising for online gaming. Planning to give it a shot this weekend.
The app version is so much better than the mobile web view. Super intuitive and everything is right at my fingertips. Get it from 1xbetdownloadapp.
Really liking the vibe here. Everything loads fast and the bonuses are actually fair compared to other places. Highly recommend br342bet