assertFalse(sourceAssetExists);
}
@Test
public void testMoveAndRenameAsset() throws AssetNotFoundException {
Repository repository = new VFSRepository(producer.getIoService());
((VFSRepository)repository).setDescriptor(descriptor);
AssetBuilder builder = AssetBuilderFactory.getAssetBuilder(Asset.AssetType.Text);
builder.content("simple content")
.type("bpmn2")
.name("process")
.location("/source");
String id = repository.createAsset(builder.getAsset());
Collection<Asset> foundAsset = repository.listAssets("/source", new FilterByExtension("bpmn2"));
assertNotNull(foundAsset);
assertEquals(1, foundAsset.size());
boolean sourceAssetExists = repository.assetExists(id);
assertTrue(sourceAssetExists);
boolean copied = repository.moveAsset(id, "/target", "renamed.bpmn2");
assertTrue(copied);
foundAsset = repository.listAssets("/target", new FilterByExtension("bpmn2"));
assertNotNull(foundAsset);
assertEquals(1, foundAsset.size());
boolean assetExists = repository.assetExists("/target/renamed.bpmn2");
assertTrue(assetExists);
foundAsset = repository.listAssets("/source", new FilterByExtension("bpmn2"));
assertNotNull(foundAsset);
assertEquals(0, foundAsset.size());
sourceAssetExists = repository.assetExists(id);
assertFalse(sourceAssetExists);
}