|
@@ -27,6 +27,8 @@ import com.google.common.collect.Sets;
|
27
|
27
|
import com.google.common.jimfs.Configuration;
|
28
|
28
|
import com.google.common.jimfs.Jimfs;
|
29
|
29
|
|
|
30
|
+import java.io.IOException;
|
|
31
|
+import java.net.URISyntaxException;
|
30
|
32
|
import java.nio.file.FileSystem;
|
31
|
33
|
import java.nio.file.Files;
|
32
|
34
|
import java.nio.file.Paths;
|
|
@@ -61,7 +63,7 @@ public class YamlProfileStoreTest {
|
61
|
63
|
}
|
62
|
64
|
|
63
|
65
|
@Test
|
64
|
|
- public void testReadProfiles() throws Exception {
|
|
66
|
+ public void testReadProfiles() throws URISyntaxException {
|
65
|
67
|
final ProfileStore store = new YamlProfileStore(Paths.get(getClass()
|
66
|
68
|
.getResource("profiles.yml").toURI()));
|
67
|
69
|
final Collection<Profile> profiles = store.readProfiles();
|
|
@@ -73,12 +75,14 @@ public class YamlProfileStoreTest {
|
73
|
75
|
}
|
74
|
76
|
|
75
|
77
|
@Test
|
76
|
|
- public void testWriteProfiles() throws Exception {
|
|
78
|
+ public void testWriteProfiles() throws IOException {
|
77
|
79
|
try (FileSystem fs = Jimfs.newFileSystem(Configuration.unix())) {
|
78
|
80
|
final ProfileStore store = new YamlProfileStore(fs.getPath("/")
|
79
|
81
|
.resolve("profiles.yml"));
|
80
|
82
|
final List<Profile> profiles = Lists.newArrayList(profile1, profile2, profile3);
|
81
|
83
|
store.writeProfiles(profiles);
|
|
84
|
+ System.out.println(Files.readAllLines(fs.getPath("/")
|
|
85
|
+ .resolve("profiles.yml")));
|
82
|
86
|
final Collection<Profile> readProfiles = store.readProfiles();
|
83
|
87
|
assertEquals(3, readProfiles.size());
|
84
|
88
|
assertTrue(readProfiles.contains(profile1));
|