@Test
public void createDatabase() {

    Id dbId = new Id("idp:a:angrybirds", "create_db");
    String dbName = dbId.encode();
    // The instance is empty so creating of a database should succeed.
    try {
        Database.Create(dbName, anyDbPermissions());
    } catch (VError vError) {
        vError.printStackTrace();
        fail(vError.toString());
    }
    // Creating the same database should raise an exception.
    boolean exceptionThrown = false;
    try {
        Database.Create(dbName, anyDbPermissions());
    } catch (VError vError) {
        assertEquals("v.io/v23/verror.Exist", vError.id);
        assertNotNull(vError.message);
        assertNotNull(vError.stack);
        assertEquals(0, vError.actionCode);
        exceptionThrown = true;
    }
    assertTrue(exceptionThrown);
}