@Test(timeout = 10000) public void testExceptionThrowingOnewayServiceAsync() throws Exception { final OnewayHelloService.AsyncIface client = Clients.newClient(clientFactory(), getURI(Handlers.EXCEPTION_ONEWAY), Handlers.EXCEPTION_ONEWAY.asyncIface(), clientOptions); final BlockingQueue<Object> resQueue = new LinkedBlockingQueue<>(); final String[] names = { "kukuman", "kukuman2" }; for (String name : names) { client.hello(name, new RequestQueuingCallback(resQueue)); } for (String ignored : names) { assertThat(resQueue.take()).isEqualTo("null"); } for (String ignored : names) { assertThat(serverReceivedNames.take()).isIn(names); } }
@Test(timeout = 10000) public void testOnewayHelloServiceAsync() throws Exception { final OnewayHelloService.AsyncIface client = Clients.newClient(clientFactory(), getURI(Handlers.ONEWAYHELLO), Handlers.ONEWAYHELLO.asyncIface(), clientOptions); final BlockingQueue<Object> resQueue = new LinkedBlockingQueue<>(); final String[] names = { "kukuman", "kukuman2" }; for (String name : names) { client.hello(name, new RequestQueuingCallback(resQueue)); } for (String ignored : names) { assertThat(resQueue.take()).isEqualTo("null"); } for (String ignored : names) { assertThat(serverReceivedNames.take()).isIn(names); } }
@Test(timeout = 10000) public void testDevNullServiceAsync() throws Exception { final DevNullService.AsyncIface client = Clients.newClient(clientFactory(), getURI(Handlers.DEVNULL), Handlers.DEVNULL.asyncIface(), clientOptions); final BlockingQueue<Object> resQueue = new LinkedBlockingQueue<>(); final String[] names = { "kukuman", "kukuman2" }; for (String name : names) { client.consume(name, new RequestQueuingCallback(resQueue)); } for (String ignored : names) { assertThat(resQueue.take()).isEqualTo("null"); } for (String ignored : names) { assertThat(serverReceivedNames.take()).isIn(names); } }
@Test public void shouldReturnNameWithMultipleTags() throws Exception { String metricName = MetricNameUtils.getMetricName(METRIC_NAME, ImmutableMap.of(TAG_KEY_2, TAG_VALUE_2, TAG_KEY_1, TAG_VALUE_1)); assertThat(metricName).isIn("metricName;tag1=tagVal1;tag2=tagVal2", "metricName;tag2=tagVal2;tag1=tagVal1"); }
@Test public void testContextNotLoaded() { try { new AnnotationConfigApplicationContext(BadConfig.class).close(); fail("Expected Exception"); } catch (IllegalStateException e) { assertThat(e.getMessage()).isIn("Could not create admin", "Could not configure topics"); } }
assertThat(receivedMessage.get()).isIn("baz", "qux"); assertThat(latch4.getCount()).isEqualTo(0L);
org.springframework.messaging.Message<?> receive = this.inputChannel.receive(1000); assertThat(receive).isNotNull(); assertThat((String) receive.getPayload()).isIn("messageContent", "messageContent2"); assertThat(receive.getHeaders().get(AwsHeaders.RECEIVED_QUEUE)).isEqualTo("testQueue"); receive = this.inputChannel.receive(1000); assertThat(receive).isNotNull(); assertThat((String) receive.getPayload()).isIn("messageContent", "messageContent2"); assertThat(receive.getHeaders().get(AwsHeaders.RECEIVED_QUEUE)).isEqualTo("testQueue");