public CouchDbConnector start() {
        var couchDbClient = new InMemoryCouchDb();
        couchDbClient.createDatabase("users");
        var stdHttpClient = new StdHttpClient(couchDbClient);
        var stdCouchDbInstance = new StdCouchDbInstance(stdHttpClient);
        CouchDbConnector couchDbConnector = new StdCouchDbConnector("users", stdCouchDbInstance);

        couchDbConnector.createDatabaseIfNotExists();

        // uploading design doc:
        var designDocString = "{\"_id\":\"_design/pac4j\",\"language\":\"javascript\",\"views\":{\"by_username\":{\"map\":\""
            + "function(doc){if (doc.username) emit(doc.username, doc);}\"},\"by_linkedid\":{\"map\":\"function(doc) {"
            + "if (doc.linkedid) emit(doc.linkedid, doc);}\"}}}";
        var objectMapper = new ObjectMapper();
        try {
            couchDbConnector.create(objectMapper.readTree(designDocString));
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }

        return couchDbConnector;
    }
Uses a local CouchDB server.

@author Elie Roux
@since 2.0.0
pac4j-couch/src/test/java/org/pac4j/couch/test/tools/CouchServer.java