Migrate to Mockito.mock(T...) where feasible

This commit is contained in:
Sam Brannen
2023-01-19 14:32:29 +01:00
parent c3d123fef7
commit c4c786596f
369 changed files with 2267 additions and 2707 deletions

View File

@@ -105,7 +105,7 @@ class Jaxb2MarshallerTests extends AbstractMarshallerTests<Jaxb2Marshaller> {
@Test
void marshalSAXResult() throws Exception {
ContentHandler contentHandler = mock(ContentHandler.class);
ContentHandler contentHandler = mock();
SAXResult result = new SAXResult(contentHandler);
marshaller.marshal(flights, result);
InOrder ordered = inOrder(contentHandler);
@@ -277,7 +277,7 @@ class Jaxb2MarshallerTests extends AbstractMarshallerTests<Jaxb2Marshaller> {
marshaller.setClassesToBeBound(BinaryObject.class);
marshaller.setMtomEnabled(true);
marshaller.afterPropertiesSet();
MimeContainer mimeContainer = mock(MimeContainer.class);
MimeContainer mimeContainer = mock();
Resource logo = new ClassPathResource("spring-ws.png", getClass());
DataHandler dataHandler = new DataHandler(new FileDataSource(logo.getFile()));
@@ -307,7 +307,7 @@ class Jaxb2MarshallerTests extends AbstractMarshallerTests<Jaxb2Marshaller> {
@Test // SPR-10806
void unmarshalStreamSourceWithXmlOptions() throws Exception {
final jakarta.xml.bind.Unmarshaller unmarshaller = mock(jakarta.xml.bind.Unmarshaller.class);
final jakarta.xml.bind.Unmarshaller unmarshaller = mock();
Jaxb2Marshaller marshaller = new Jaxb2Marshaller() {
@Override
public jakarta.xml.bind.Unmarshaller createUnmarshaller() {
@@ -341,7 +341,7 @@ class Jaxb2MarshallerTests extends AbstractMarshallerTests<Jaxb2Marshaller> {
@Test // SPR-10806
void unmarshalSaxSourceWithXmlOptions() throws Exception {
final jakarta.xml.bind.Unmarshaller unmarshaller = mock(jakarta.xml.bind.Unmarshaller.class);
final jakarta.xml.bind.Unmarshaller unmarshaller = mock();
Jaxb2Marshaller marshaller = new Jaxb2Marshaller() {
@Override
public jakarta.xml.bind.Unmarshaller createUnmarshaller() {

View File

@@ -83,7 +83,7 @@ public class Jaxb2UnmarshallerTests extends AbstractUnmarshallerTests<Jaxb2Marsh
unmarshaller.setClassesToBeBound(BinaryObject.class);
unmarshaller.setMtomEnabled(true);
unmarshaller.afterPropertiesSet();
MimeContainer mimeContainer = mock(MimeContainer.class);
MimeContainer mimeContainer = mock();
Resource logo = new ClassPathResource("spring-ws.png", getClass());
DataHandler dataHandler = new DataHandler(new FileDataSource(logo.getFile()));

View File

@@ -155,7 +155,7 @@ class XStreamMarshallerTests {
@Test
void marshalSaxResult() throws Exception {
ContentHandler contentHandler = mock(ContentHandler.class);
ContentHandler contentHandler = mock();
SAXResult result = new SAXResult(contentHandler);
marshaller.marshal(flight, result);
InOrder ordered = inOrder(contentHandler);