}
public void testFileMetadata() {
InputStream is = getClass().getResourceAsStream("/test_file_metadata.xml");
FileInfoWithMetadata expects = new FileInfoWithMetadataImpl(
URI
.create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3"),
"testfile.txt",
dateService.fromSeconds(1254000180),
true,
dateService.fromSeconds(1254000181),
"adrian@jclouds.org",
3,
false,
dateService.fromSeconds(1254000182),
false,
"text/plain",
5,
URI
.create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/content"),
URI
.create("https://pcsbeta.mezeo.net/v2/containers/C4DA95C2-B298-11DE-8D7C-2B1FE4F2B99C"),
URI
.create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/permissions"),
URI
.create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/tags"),
URI
.create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/metadata"),
// Note that we should convert uppercase to lowercase, since most clouds do anyway
ImmutableMap
.<String, URI> of(
"foo",
URI
.create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/metadata/Foo")),
URI
.create("https://pcsbeta.mezeo.net/v2/files/9E4C5AFA-A98B-11DE-8B4C-C3884B4A2DA3/thumbnail"));
FileInfoWithMetadata result = (FileInfoWithMetadata) factory.create(
injector.getInstance(FileHandler.class)).parse(is);
assertEquals(result, expects);
}