package com.telephoners.krakyournet.ctf;

import com.telephoners.krakyournet.ctf.beans.immutables.TestBean;
import org.junit.Test;
import org.lightcouch.CouchDbClient;

import java.util.List;
import java.util.stream.Stream;

public class LightCouchTest
{
    @Test
    public void test()
    {
        CouchDbClient dbClient = new CouchDbClient("testdb", true, "http", "127.0.0.1", 5984, "admin", "password");

        Stream.of("1","2","3","4","5")
                .map(TestBean::of)
                .forEach(dbClient::save);


        List<TestBean> all_docs = dbClient.view("_all_docs").query(TestBean.class);
        int size = all_docs.size();
    }
}
