Polish SerializationTestUtils, clean up warnings, etc.

This commit is contained in:
Sam Brannen
2020-06-20 18:17:03 +02:00
parent 9d5881e0ad
commit ab0e651547
43 changed files with 133 additions and 126 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -325,6 +325,7 @@ public class StubTextMessage implements TextMessage {
}
@Override
@SuppressWarnings("rawtypes")
public boolean isBodyAssignableTo(Class c) throws JMSException {
return false;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -87,9 +87,8 @@ public class JmsNamespaceHandlerTests {
containers = context.getBeansOfType(GenericMessageEndpointManager.class);
assertThat(containers.size()).as("Context should contain 3 JCA endpoint containers").isEqualTo(3);
Map<String, JmsListenerContainerFactory> containerFactories =
context.getBeansOfType(JmsListenerContainerFactory.class);
assertThat(containerFactories.size()).as("Context should contain 3 JmsListenerContainerFactory instances").isEqualTo(3);
assertThat(context.getBeansOfType(JmsListenerContainerFactory.class))
.as("Context should contain 3 JmsListenerContainerFactory instances").hasSize(3);
}
@Test

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -121,6 +121,7 @@ public class SimpleMessageListenerContainerTests {
GenericApplicationContext context = new GenericApplicationContext();
context.getBeanFactory().registerSingleton("messageListenerContainer", this.container);
context.refresh();
context.close();
verify(connection).setExceptionListener(this.container);
}
@@ -151,6 +152,7 @@ public class SimpleMessageListenerContainerTests {
GenericApplicationContext context = new GenericApplicationContext();
context.getBeanFactory().registerSingleton("messageListenerContainer", this.container);
context.refresh();
context.close();
verify(connection).setExceptionListener(this.container);
verify(connection).start();

View File

@@ -341,7 +341,7 @@ public class MessagingMessageListenerAdapterTests {
}
protected MessagingMessageListenerAdapter getSimpleInstance(String methodName, Class... parameterTypes) {
protected MessagingMessageListenerAdapter getSimpleInstance(String methodName, Class<?>... parameterTypes) {
Method m = ReflectionUtils.findMethod(SampleBean.class, methodName, parameterTypes);
return createInstance(m);
}
@@ -353,7 +353,7 @@ public class MessagingMessageListenerAdapterTests {
}
protected MessagingMessageListenerAdapter getPayloadInstance(final Object payload,
String methodName, Class... parameterTypes) {
String methodName, Class<?>... parameterTypes) {
Method method = ReflectionUtils.findMethod(SampleBean.class, methodName, parameterTypes);
MessagingMessageListenerAdapter adapter = new MessagingMessageListenerAdapter() {
@@ -435,6 +435,7 @@ public class MessagingMessageListenerAdapterTests {
interface Summary {};
interface Full extends Summary {};
@SuppressWarnings("unused")
private static class SampleResponse {
private int counter = 42;
@@ -445,9 +446,6 @@ public class MessagingMessageListenerAdapterTests {
@JsonView(Full.class)
private String description;
SampleResponse() {
}
public SampleResponse(String name, String description) {
this.name = name;
this.description = description;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -392,6 +392,7 @@ public class JmsInvokerTests {
}
@Override
@SuppressWarnings("rawtypes")
public boolean isBodyAssignableTo(Class c) throws JMSException {
return false;
}
@@ -451,6 +452,7 @@ public class JmsInvokerTests {
}
@Override
@SuppressWarnings("rawtypes")
public Enumeration getPropertyNames() throws JMSException {
return null;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -311,6 +311,7 @@ public class MappingJackson2MessageConverterTests {
private interface Full extends Summary {};
@SuppressWarnings("unused")
private static class MyAnotherBean {
@JsonView(Summary.class)