@Test(expected = RepositoryException.class)
public void testWritePrivileges_throws() throws Exception {

    final Session session = mock(Session.class);
    final Workspace workspace = mock(Workspace.class);
    when(session.getWorkspace()).thenReturn(workspace);
    PrivilegeXmlExporter.writePrivileges(StringWriter::new, session, Collections.emptyList(), false);
}