@Test
public void shouldExportVdb() throws Exception {

    String tmpDirPath = System.getProperty("java.io.tmpdir");
    File tmpDir = new File(tmpDirPath);
    long timestamp = System.currentTimeMillis();
    myFileDir = new File(tmpDir, "myfile-" + timestamp);
    assertTrue(myFileDir.mkdir());
    File vdbDestFile = new File(myFileDir, "vdbFile.xml");
    Properties parameters = new Properties();
    parameters.setProperty("files-home-path-property", myFileDir.getAbsolutePath());
    parameters.setProperty("file-path-property", vdbDestFile.getName());
    Vdb vdb = mock(Vdb.class);
    String sampleExample = TestUtilities.streamToString(TestUtilities.sampleExample());
    when(vdb.export(getTransaction(), parameters)).thenReturn(sampleExample.getBytes());
    when(vdb.getName(getTransaction())).thenReturn(TestUtilities.SAMPLE_VDB_FILE);
    wsMgr.exportArtifact(getTransaction(), vdb, "file", parameters);
    File cmpFile = TestUtilities.createTempFile("sampleExampleFile", XML_SUFFIX);
    FileUtils.write(TestUtilities.sampleExample(), cmpFile);
    TestUtilities.compareFileContents(cmpFile, vdbDestFile);
}