Merge branch '2.7.x'

This commit is contained in:
Stephane Nicoll
2022-02-01 11:15:49 +01:00
195 changed files with 1267 additions and 1293 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 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.
@@ -28,7 +28,7 @@ import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import static org.mockito.Mockito.verify;
import static org.mockito.BDDMockito.then;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -58,7 +58,7 @@ class SpyBeanSampleDataJpaApplicationTests {
@Test
void testHome() throws Exception {
this.mvc.perform(get("/")).andExpect(status().isOk()).andExpect(content().string("Bath"));
verify(this.repository).findByNameAndCountryAllIgnoringCase("Bath", "UK");
then(this.repository).should().findByNameAndCountryAllIgnoringCase("Bath", "UK");
}
}

View File

@@ -36,7 +36,7 @@ import org.springframework.ws.test.server.MockWebServiceClient;
import org.springframework.ws.test.server.RequestCreators;
import org.springframework.ws.test.server.ResponseMatchers;
import static org.mockito.Mockito.verify;
import static org.mockito.BDDMockito.then;
/**
* Tests for {@link SampleWsApplicationTests} that use {@link WebServiceServerTest} and
@@ -64,7 +64,8 @@ class WebServiceServerTestSampleWsApplicationTests {
StreamSource source = new StreamSource(new StringReader(request));
this.client.sendRequest(RequestCreators.withPayload(source)).andExpect(ResponseMatchers.noFault());
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
verify(this.service).bookHoliday(dateFormat.parse("2013-10-20"), dateFormat.parse("2013-11-22"), "John Doe");
then(this.service).should().bookHoliday(dateFormat.parse("2013-10-20"), dateFormat.parse("2013-11-22"),
"John Doe");
}
}