}
public void before() throws IOException, URISyntaxException, CouchDbException {
URI currentUri = getServerUri();
serverURI = currentUri;
Server currentServer = new ServerImpl( serverURI.getHost(), currentUri.getPort() );
final String username = getUsername();
final String password = getPassword();
if ( username != null && password != null ) {
currentServer.setCredentials( AuthScope.ANY, new Credentials() {
@Override
public Principal getUserPrincipal() {
return new UserPrincipal( username );
}