use of com.couchbase.client.test.TestNodeConfig in project couchbase-jvm-clients by couchbase.
the class ViewEndpointIntegrationTest method dispatchGenericRequest.
/**
* Makes sure that we can execute a generic view management request.
*
* <p>The mock does not support hitting the / path for views, so this test is ignored there.</p>
*/
@Test
@IgnoreWhen(clusterTypes = ClusterType.MOCKED)
void dispatchGenericRequest() throws Exception {
TestNodeConfig node = config().nodes().get(0);
ViewEndpoint endpoint = new ViewEndpoint(serviceContext, node.hostname(), node.ports().get(Services.VIEW));
endpoint.connect();
waitUntilCondition(() -> endpoint.state() == EndpointState.CONNECTED);
CoreHttpRequest request = CoreHttpRequest.builder(CoreCommonOptions.of(Duration.ofSeconds(5), null, null), serviceContext, HttpMethod.GET, CoreHttpPath.path("/"), RequestTarget.views(config().bucketname())).build();
endpoint.send(request);
CoreHttpResponse response = request.response().get();
assertEquals(ResponseStatus.SUCCESS, response.status());
assertNotNull(response.content());
assertTrue(response.content().length > 0);
endpoint.disconnect();
waitUntilCondition(() -> endpoint.state() == EndpointState.DISCONNECTED);
}
use of com.couchbase.client.test.TestNodeConfig in project couchbase-jvm-clients by couchbase.
the class ViewEndpointIntegrationTest method beforeAll.
@BeforeAll
static void beforeAll() {
TestNodeConfig node = config().nodes().get(0);
env = environment().ioConfig(IoConfig.captureTraffic(ServiceType.VIEWS)).build();
serviceContext = new ServiceContext(new CoreContext(null, 1, env, authenticator()), node.hostname(), node.ports().get(Services.VIEW), ServiceType.VIEWS, Optional.empty());
}
use of com.couchbase.client.test.TestNodeConfig in project couchbase-jvm-clients by couchbase.
the class KeyValueChannelIntegrationTest method failWithInvalidPasswordCredential.
@Test
@IgnoreWhen(clusterTypes = ClusterType.MOCKED)
void failWithInvalidPasswordCredential() throws Exception {
TestNodeConfig node = config().nodes().get(0);
Bootstrap bootstrap = new Bootstrap().remoteAddress(node.hostname(), node.ports().get(Services.KV)).group(eventLoopGroup).channel(NioSocketChannel.class).handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) {
new KeyValueEndpoint.KeyValuePipelineInitializer(endpointContext, Optional.of(config().bucketname()), PasswordAuthenticator.create(config().adminUsername(), "djslkfsdfsoufhoshfoishgs")).init(null, ch.pipeline());
}
});
assertAuthenticationFailure(bootstrap, "Authentication Failure");
}
use of com.couchbase.client.test.TestNodeConfig in project couchbase-jvm-clients by couchbase.
the class OpenTelemetryIntegrationTest method beforeAll.
@BeforeAll
static void beforeAll() {
TestNodeConfig config = config().firstNodeWith(Services.KV).get();
cluster = Cluster.connect(String.format("couchbase://%s:%d", config.hostname(), config.ports().get(Services.KV)), clusterOptions(config().adminUsername(), config().adminPassword()).environment(env -> env.requestTracer(OpenTelemetryRequestTracer.wrap(otelTesting.getOpenTelemetry()))));
Bucket bucket = cluster.bucket(config().bucketname());
collection = bucket.defaultCollection();
bucket.waitUntilReady(Duration.ofSeconds(30));
}
use of com.couchbase.client.test.TestNodeConfig in project couchbase-jvm-clients by couchbase.
the class OpenTracingIntegrationTest method beforeAll.
@BeforeAll
static void beforeAll() {
tracer = new MockTracer();
TestNodeConfig config = config().firstNodeWith(Services.KV).get();
cluster = Cluster.connect(String.format("couchbase://%s:%d", config.hostname(), config.ports().get(Services.KV)), clusterOptions(config().adminUsername(), config().adminPassword()).environment(env -> env.requestTracer(OpenTracingRequestTracer.wrap(tracer))));
Bucket bucket = cluster.bucket(config().bucketname());
collection = bucket.defaultCollection();
bucket.waitUntilReady(Duration.ofSeconds(30));
}
Aggregations