Created
June 10, 2014 23:36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@When("I put a message on the queue") | |
public void putMessageOnQueue() throws InterruptedException { | |
log.info(">>> When: I put a message on the queue"); | |
jmsTemplate.send("TEST.QUEUE", new MessageCreator() { | |
@Override | |
public Message createMessage(final Session session) throws JMSException { | |
return session.createTextMessage("!!!test"); | |
} | |
}); | |
TimeUnit.SECONDS.sleep(3); | |
} | |
@When("processing is set to fail") | |
public void injectProcessingFailure() { | |
log.info(">>> When: processing is set to fail"); | |
ThrowExceptionAspectBean exceptionInjector = (ThrowExceptionAspectBean)ac.getBean("throwExceptionAspectBean"); | |
exceptionInjector.setExceptionFlag(true); | |
} | |
@Then("value is stored in database") | |
public void checkMessageStoredInDatabase() { | |
log.info(">>> Then: value is stored in database"); | |
assertEquals(1, SimpleJdbcTestUtils.countRowsInTable(new SimpleJdbcTemplate(jdbcTemplate), "message")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment