@Test public void shouldFindQueue() { String queueName = "testqueue"; InMemoryQueue queue = new InMemoryQueue(); queue.setName(queueName); inMemoryQueueRepository.save(queueName, queue); InMemoryQueue savedqueue = inMemoryQueueRepository.find(queueName); assertNotNull(savedqueue); }
@Test(expected = NoSuchElementException.class) public void shouldThrowNoSuchElementException() { String queueName = "unknownqueue"; inMemoryQueueRepository.find(queueName); fail("Exception not thrown"); }