Polishing
This commit is contained in:
@@ -72,13 +72,19 @@ import static org.mockito.BDDMockito.*;
|
||||
public class JmsTemplateTests {
|
||||
|
||||
private Context jndiContext;
|
||||
|
||||
private ConnectionFactory connectionFactory;
|
||||
|
||||
protected Connection connection;
|
||||
|
||||
private Session session;
|
||||
|
||||
private Destination queue;
|
||||
|
||||
private int deliveryMode = DeliveryMode.PERSISTENT;
|
||||
|
||||
private int priority = 9;
|
||||
|
||||
private int timeToLive = 10000;
|
||||
|
||||
|
||||
@@ -94,8 +100,7 @@ public class JmsTemplateTests {
|
||||
queue = mock(Queue.class);
|
||||
|
||||
given(connectionFactory.createConnection()).willReturn(connection);
|
||||
given(connection.createSession(useTransactedTemplate(),
|
||||
Session.AUTO_ACKNOWLEDGE)).willReturn(session);
|
||||
given(connection.createSession(useTransactedTemplate(), Session.AUTO_ACKNOWLEDGE)).willReturn(session);
|
||||
given(session.getTransacted()).willReturn(useTransactedSession());
|
||||
given(jndiContext.lookup("testDestination")).willReturn(queue);
|
||||
}
|
||||
@@ -126,6 +131,7 @@ public class JmsTemplateTests {
|
||||
return session;
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testExceptionStackTrace() {
|
||||
JMSException jmsEx = new JMSException("could not connect");
|
||||
|
||||
@@ -30,12 +30,12 @@ public class JmsTemplateTransactedTests extends JmsTemplateTests {
|
||||
|
||||
private Session localSession;
|
||||
|
||||
|
||||
@Override
|
||||
public void setupMocks() throws Exception {
|
||||
super.setupMocks();
|
||||
this.localSession = mock(Session.class);
|
||||
given(this.connection.createSession(false,
|
||||
Session.AUTO_ACKNOWLEDGE)).willReturn(this.localSession);
|
||||
given(this.connection.createSession(false, Session.AUTO_ACKNOWLEDGE)).willReturn(this.localSession);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user