Skip to content

Commit e5096be

Browse files
committed
Polishing
1 parent f79562f commit e5096be

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

spring-test/src/main/java/org/springframework/test/web/servlet/DefaultMvcResult.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ public Object getAsyncResult(long timeToWait) {
151151
}
152152

153153
/**
154-
* True if is there a latch was not set, or the latch count reached 0.
154+
* True if the latch count reached 0 within the specified timeout.
155155
*/
156156
private boolean awaitAsyncDispatch(long timeout) {
157157
Assert.state(this.asyncDispatchLatch != null,
158-
"The asynDispatch CountDownLatch was not set by the TestDispatcherServlet.\n");
158+
"The asyncDispatch CountDownLatch was not set by the TestDispatcherServlet.\n");
159159
try {
160160
return this.asyncDispatchLatch.await(timeout, TimeUnit.MILLISECONDS);
161161
}

spring-test/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,23 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.test.web.servlet;
1718

1819
import java.util.concurrent.CountDownLatch;
1920

20-
import org.junit.Before;
2121
import org.junit.Test;
2222

2323
import org.springframework.mock.web.MockHttpServletRequest;
2424

25-
import static org.junit.Assert.*;
26-
2725
/**
2826
* Test fixture for {@link DefaultMvcResult}.
2927
*
3028
* @author Rossen Stoyanchev
3129
*/
3230
public class DefaultMvcResultTests {
3331

34-
private DefaultMvcResult mvcResult;
35-
36-
@Before
37-
public void setup() {
38-
MockHttpServletRequest request = new MockHttpServletRequest();
39-
this.mvcResult = new DefaultMvcResult(request, null);
40-
}
32+
private final DefaultMvcResult mvcResult = new DefaultMvcResult(new MockHttpServletRequest(), null);
4133

4234
@Test
4335
public void getAsyncResultSuccess() {

0 commit comments

Comments
 (0)