use of org.apache.sling.ide.test.impl.helpers.SpyCommand in project sling by apache.
the class ResourceChangeCommandFactoryTest method commandForAddedOrUpdatedNtFolder.
@Test
public void commandForAddedOrUpdatedNtFolder() throws CoreException {
// create a sling:Folder at /content/test-root/nested
InputStream childContentXml = getClass().getResourceAsStream("sling-folder-nodetype.xml");
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/nested/.content.xml"), childContentXml);
SpyCommand<?> command = (SpyCommand<?>) factory.newCommandForAddedOrUpdated(spyRepo, contentProject.findMember("jcr_root/content/test-root"));
assertThat("command.path", command.getPath(), nullValue());
assertThat("command.resource.path", command.getResourceProxy().getPath(), equalTo("/content/test-root"));
assertThat("command.resource.properties", command.getResourceProxy().getProperties(), equalTo(singletonMap("jcr:primaryType", (Object) "nt:folder")));
assertThat("command.fileinfo", command.getFileInfo(), nullValue());
assertThat("command.kind", command.getSpyKind(), equalTo(SpyCommand.Kind.ADD_OR_UPDATE));
}
Aggregations