You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2021/09/19 15:07:01 UTC
[maven] 03/06: Using displayName in Interface.
This is an automated email from the ASF dual-hosted git repository.
khmarbaise pushed a commit to branch MODELTESTS_IMPROVEMENT
in repository https://gitbox.apache.org/repos/asf/maven.git
commit f6453404b0342811840c054044b16d3b688eda8d
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Mon Dec 9 20:42:00 2019 +0100
Using displayName in Interface.
---
.../src/test/java/org/apache/maven/model/ModelTestInterface.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/maven-model/src/test/java/org/apache/maven/model/ModelTestInterface.java b/maven-model/src/test/java/org/apache/maven/model/ModelTestInterface.java
index a69566b..b51bc3e 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ModelTestInterface.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ModelTestInterface.java
@@ -19,6 +19,7 @@ package org.apache.maven.model;
* under the License.
*/
+import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.DisplayNameGenerator;
import org.junit.jupiter.api.Test;
@@ -36,18 +37,21 @@ interface ModelTestInterface< T >
}
@Test
+ @DisplayName( "hashCode should not fail with null." )
default void hashCodeNullSafe()
{
assertThatCode( () -> createNewInstance( this.getClass() ).hashCode() ).doesNotThrowAnyException();
}
@Test
+ @DisplayName( "equals should not fail with null." )
default void equalsNullSafe() throws ReflectiveOperationException
{
assertThat( createNewInstance( this.getClass() ).equals( null ) ).isFalse();
}
@Test
+ @DisplayName( "equals should result in false for two different instances." )
default void equalsSameToBeFalse() throws ReflectiveOperationException
{
T firstInstance = createNewInstance( this.getClass() );
@@ -56,6 +60,7 @@ interface ModelTestInterface< T >
}
@Test
+ @DisplayName( "toString should not be null." )
default void toStringNullSafe() throws ReflectiveOperationException
{
assertThat( createNewInstance( this.getClass() ).toString() ).isNotNull();