Suppress deprecation warnings in JmsInvokerTests
This commit is contained in:
parent
45491f0756
commit
6a2939a4d4
|
@ -51,42 +51,38 @@ import static org.mockito.Mockito.mock;
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
*/
|
*/
|
||||||
public class JmsInvokerTests {
|
class JmsInvokerTests {
|
||||||
|
|
||||||
private QueueConnectionFactory mockConnectionFactory;
|
private QueueConnectionFactory mockConnectionFactory = mock(QueueConnectionFactory.class);
|
||||||
|
|
||||||
private QueueConnection mockConnection;
|
private QueueConnection mockConnection = mock(QueueConnection.class);
|
||||||
|
|
||||||
private QueueSession mockSession;
|
private QueueSession mockSession = mock(QueueSession.class);
|
||||||
|
|
||||||
private Queue mockQueue;
|
private Queue mockQueue = mock(Queue.class);
|
||||||
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUpMocks() throws Exception {
|
void setUpMocks() throws Exception {
|
||||||
mockConnectionFactory = mock(QueueConnectionFactory.class);
|
|
||||||
mockConnection = mock(QueueConnection.class);
|
|
||||||
mockSession = mock(QueueSession.class);
|
|
||||||
mockQueue = mock(Queue.class);
|
|
||||||
|
|
||||||
given(mockConnectionFactory.createConnection()).willReturn(mockConnection);
|
given(mockConnectionFactory.createConnection()).willReturn(mockConnection);
|
||||||
given(mockConnection.createSession(false, Session.AUTO_ACKNOWLEDGE)).willReturn(mockSession);
|
given(mockConnection.createSession(false, Session.AUTO_ACKNOWLEDGE)).willReturn(mockSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJmsInvokerProxyFactoryBeanAndServiceExporter() throws Throwable {
|
void jmsInvokerProxyFactoryBeanAndServiceExporter() throws Throwable {
|
||||||
doTestJmsInvokerProxyFactoryBeanAndServiceExporter(false);
|
doTestJmsInvokerProxyFactoryBeanAndServiceExporter(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJmsInvokerProxyFactoryBeanAndServiceExporterWithDynamicQueue() throws Throwable {
|
void jmsInvokerProxyFactoryBeanAndServiceExporterWithDynamicQueue() throws Throwable {
|
||||||
given(mockSession.createQueue("myQueue")).willReturn(mockQueue);
|
given(mockSession.createQueue("myQueue")).willReturn(mockQueue);
|
||||||
doTestJmsInvokerProxyFactoryBeanAndServiceExporter(true);
|
doTestJmsInvokerProxyFactoryBeanAndServiceExporter(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void receiveTimeoutExpired() {
|
@SuppressWarnings("deprecation")
|
||||||
|
void receiveTimeoutExpired() {
|
||||||
JmsInvokerProxyFactoryBean pfb = new JmsInvokerProxyFactoryBean() {
|
JmsInvokerProxyFactoryBean pfb = new JmsInvokerProxyFactoryBean() {
|
||||||
@Override
|
@Override
|
||||||
protected Message doExecuteRequest(Session session, Queue queue, Message requestMessage) throws JMSException {
|
protected Message doExecuteRequest(Session session, Queue queue, Message requestMessage) throws JMSException {
|
||||||
|
@ -106,6 +102,7 @@ public class JmsInvokerTests {
|
||||||
.withMessageContaining("getAge");
|
.withMessageContaining("getAge");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void doTestJmsInvokerProxyFactoryBeanAndServiceExporter(boolean dynamicQueue) throws Throwable {
|
private void doTestJmsInvokerProxyFactoryBeanAndServiceExporter(boolean dynamicQueue) throws Throwable {
|
||||||
TestBean target = new TestBean("myname", 99);
|
TestBean target = new TestBean("myname", 99);
|
||||||
|
|
||||||
|
@ -154,9 +151,9 @@ public class JmsInvokerTests {
|
||||||
|
|
||||||
private static class ResponseStoringProducer implements MessageProducer {
|
private static class ResponseStoringProducer implements MessageProducer {
|
||||||
|
|
||||||
public Message response;
|
Message response;
|
||||||
|
|
||||||
public boolean closed = false;
|
boolean closed = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDisableMessageID(boolean b) throws JMSException {
|
public void setDisableMessageID(boolean b) throws JMSException {
|
||||||
|
|
Loading…
Reference in New Issue