@Override public Config getConfiguration() { return delegate.getConfiguration(); }
@Override public Config getConfiguration() { return delegate.getConfiguration(); }
private JsonObject config() { String token = client.getConfiguration().getOauthToken(); if (token == null) { token = "some-token"; } return new JsonObject() .put("token", token) .put("host", "localhost") .put("ssl", false) .put("port", port); }
private JsonObject config() { String token = client.getConfiguration().getOauthToken(); if (token == null) { token = "some-token"; } return new JsonObject() .put("token", token) .put("host", "localhost") .put("ssl", false) .put("port", port); }
@Before public void setUp(TestContext tc) throws MalformedURLException { vertx = Vertx.vertx(); vertx.exceptionHandler(tc.exceptionHandler()); Service svc1 = getSimpleService(); Service svc2 = getHttpService(); Service svc3 = getSimpleService(); svc3.getMetadata().setName("service3"); svc3.getMetadata().setUid("uid-3"); server = getServer(); server.expect().get().withPath("/api/v1/namespaces/default/services").andReturn(200, new ServiceListBuilder() .addToItems(svc1, svc2).withNewMetadata("1234", "/self").build()).always(); server.expect().get().withPath("/api/v1/namespaces/default/services?watch=true&resourceVersion=1234") .andReturnChunked(200, new WatchEvent(svc3, "ADDED"), "\n", new WatchEvent(svc1, "DELETED"), "\n", new WatchEvent(getUpdatedHttpService(), "MODIFIED"), "\n").once(); Service svc96 = getService96(); server.expect().get().withPath("/api/v1/namespaces/issue96/services").andReturn(200, new ServiceListBuilder() .addToItems(svc96) .withNewMetadata("1235", "/self").build()).always(); server.expect().get().withPath("/api/v1/namespaces/issue96/services?watch=true&resourceVersion=1235") .andReturnChunked(200, new WatchEvent(getUpdatedService96(), "MODIFIED"), "\n", new WatchEvent(getUpdatedService96(), "DELETED"), "\n").once(); server.init(); client = server.createClient(); port = new URL(client.getConfiguration().getMasterUrl()).getPort(); }
@Before public void setUp(TestContext tc) throws MalformedURLException { vertx = Vertx.vertx(); vertx.exceptionHandler(tc.exceptionHandler()); Service svc1 = getSimpleService(); Service svc2 = getHttpService(); Service svc3 = getSimpleService(); svc3.getMetadata().setName("service3"); svc3.getMetadata().setUid("uid-3"); server = getServer(); server.expect().get().withPath("/api/v1/namespaces/default/services").andReturn(200, new ServiceListBuilder() .addToItems(svc1, svc2).withNewMetadata("1234", "/self").build()).always(); server.expect().get().withPath("/api/v1/namespaces/default/services?watch=true&resourceVersion=1234") .andReturnChunked(200, new WatchEvent(svc3, "ADDED"), "\n", new WatchEvent(svc1, "DELETED"), "\n", new WatchEvent(getUpdatedHttpService(), "MODIFIED"), "\n").once(); Service svc96 = getService96(); server.expect().get().withPath("/api/v1/namespaces/issue96/services").andReturn(200, new ServiceListBuilder() .addToItems(svc96) .withNewMetadata("1235", "/self").build()).always(); server.expect().get().withPath("/api/v1/namespaces/issue96/services?watch=true&resourceVersion=1235") .andReturnChunked(200, new WatchEvent(getUpdatedService96(), "MODIFIED"), "\n", new WatchEvent(getUpdatedService96(), "DELETED"), "\n").once(); server.init(); client = server.createClient(); port = new URL(client.getConfiguration().getMasterUrl()).getPort(); }