use of org.hamcrest.text.StringContains in project motech by motech.
the class BrokerStatisticsControllerTest method shouldReturnMessageInformationGivenQueueName.
@Test
public void shouldReturnMessageInformationGivenQueueName() throws Exception {
given(mBeanService.getQueueMessages("foo")).willReturn(Arrays.asList(new QueueMessage("123", false, new DateTime())));
mockMvc.perform(MockMvcRequestBuilders.get("/queues/browse?queueName=foo")).andExpect(status().isOk()).andExpect(content().string(new StringContains("\"messageId\":\"123"))).andExpect(content().string(new StringContains("\"redelivered\":false")));
}
use of org.hamcrest.text.StringContains in project HotswapAgent by HotswapProjects.
the class AgentLoggerHandlerTest method testHandler.
@Test
public void testHandler() {
AgentLoggerHandler handler = new AgentLoggerHandler();
handler.setPrintStream(printStream);
context.checking(new Expectations() {
{
oneOf(printStream).println(with(new StringContains("DEBUG (org.hotswap.agent.config.PluginManager) - A 1 B 2 C 3")));
}
});
handler.print(PluginManager.class, AgentLogger.Level.DEBUG, "A {} B {} C {}", null, "1", 2, 3L);
}
use of org.hamcrest.text.StringContains in project motech by motech.
the class BrokerStatisticsControllerTest method shouldReturnAllQueueInformation.
@Test
public void shouldReturnAllQueueInformation() throws Exception {
given(mBeanService.getQueueStatistics()).willReturn(Arrays.asList(new QueueMBean("queue-1"), new QueueMBean("queue-2")));
mockMvc.perform(MockMvcRequestBuilders.get("/queues")).andExpect(status().isOk()).andExpect(content().string(new StringContains("\"destination\":\"queue-1\""))).andExpect(content().string(new StringContains("\"destination\":\"queue-2\"")));
}
use of org.hamcrest.text.StringContains in project motech by motech.
the class BrokerStatisticsControllerTest method shouldReturnAllTopicInformation.
@Test
public void shouldReturnAllTopicInformation() throws Exception {
given(mBeanService.getTopicStatistics()).willReturn(Arrays.asList(new TopicMBean("topic-1"), new TopicMBean("topic-2")));
mockMvc.perform(MockMvcRequestBuilders.get("/topics")).andExpect(status().isOk()).andExpect(content().string(new StringContains("\"destination\":\"topic-1\""))).andExpect(content().string(new StringContains("\"destination\":\"topic-2\"")));
}
Aggregations