Polishing.

Defer message creation. Add test.

See #3091
This commit is contained in:
Mark Paluch
2024-05-14 14:46:22 +02:00
parent b8e230c4e1
commit fd1ab30a60
2 changed files with 16 additions and 6 deletions

View File

@@ -41,7 +41,7 @@ import org.springframework.util.Assert;
* @author Thomas Darimont
* @author Jens Schauder
* @author Mark Paluch
* @author Konstntin Ignatyev
* @author Konstantin Ignatyev
*/
public abstract class AbstractRepositoryMetadata implements RepositoryMetadata {
@@ -57,7 +57,8 @@ public abstract class AbstractRepositoryMetadata implements RepositoryMetadata {
public AbstractRepositoryMetadata(Class<?> repositoryInterface) {
Assert.notNull(repositoryInterface, "Given type must not be null");
Assert.isTrue(repositoryInterface.isInterface(), "Given type ["+ repositoryInterface.getName()+"] must be an interface");
Assert.isTrue(repositoryInterface.isInterface(),
() -> String.format("Given type %s must be an interface", repositoryInterface.getName()));
this.repositoryInterface = repositoryInterface;
this.typeInformation = TypeInformation.of(repositoryInterface);