Search in sources :

Example 1 with Builder

use of com.couchbase.client.dcp.Client.Builder in project components by Talend.

the class CouchbaseStreamingConnectionTest method setup.

@Before
public void setup() {
    PowerMockito.mockStatic(Client.class);
    Builder builder = Mockito.mock(Builder.class);
    Mockito.when(builder.connectTimeout(Mockito.anyLong())).thenReturn(builder);
    Mockito.when(builder.hostnames(Mockito.anyString())).thenReturn(builder);
    Mockito.when(builder.bucket(Mockito.anyString())).thenReturn(builder);
    Mockito.when(builder.password(Mockito.anyString())).thenReturn(builder);
    Mockito.when(builder.controlParam(Mockito.any(Names.class), Mockito.any())).thenReturn(builder);
    Mockito.when(builder.bufferAckWatermark(Mockito.anyInt())).thenReturn(builder);
    client = Mockito.mock(Client.class);
    PowerMockito.when(Client.configure()).thenReturn(builder);
    Mockito.when(builder.build()).thenReturn(client);
    streamingConnection = new CouchbaseStreamingConnection("localhost", "", "testPassword");
}
Also used : Names(com.couchbase.client.dcp.config.DcpControl.Names) Builder(com.couchbase.client.dcp.Client.Builder) Client(com.couchbase.client.dcp.Client) Before(org.junit.Before)

Aggregations

Client (com.couchbase.client.dcp.Client)1 Builder (com.couchbase.client.dcp.Client.Builder)1 Names (com.couchbase.client.dcp.config.DcpControl.Names)1 Before (org.junit.Before)1