Skip to content

Commit f7376bd

Browse files
committed
Better assertion message in MockPart
Issue: SPR-16767
1 parent f9e31b5 commit f7376bd

File tree

2 files changed

+4
-4
lines changed
  • spring-test/src/main/java/org/springframework/mock/web
  • spring-web/src/test/java/org/springframework/mock/web/test

2 files changed

+4
-4
lines changed

spring-test/src/main/java/org/springframework/mock/web/MockPart.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ public MockPart(String name, @Nullable byte[] content) {
6262
* @see #getHeaders()
6363
*/
6464
public MockPart(String name, @Nullable String filename, @Nullable byte[] content) {
65-
Assert.hasLength(name, "Name must not be null");
65+
Assert.hasLength(name, "'name' must not be empty");
6666
this.name = name;
6767
this.filename = filename;
6868
this.content = (content != null ? content : new byte[0]);

spring-web/src/test/java/org/springframework/mock/web/test/MockPart.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ public MockPart(String name, byte[] content) {
6060
* @see #getHeaders()
6161
*/
6262
public MockPart(String name, String filename, byte[] content) {
63-
Assert.hasLength(name, "Name must not be null");
63+
Assert.hasLength(name, "'name' must not be empty");
6464
this.name = name;
6565
this.filename = filename;
6666
this.content = (content != null ? content : new byte[0]);

0 commit comments

Comments
 (0)