-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests to cover equals/hashCode/toString
- Loading branch information
Nicolas Dos Santos
committed
Nov 21, 2022
1 parent
ff5a962
commit 6ad2895
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
generator/src/test/java/com/weedow/schemaorg/generator/core/ContextVerifierTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.weedow.schemaorg.generator.core; | ||
|
||
import com.jparams.verifier.tostring.ToStringVerifier; | ||
import com.weedow.schemaorg.generator.model.Type; | ||
import nl.jqno.equalsverifier.EqualsVerifier; | ||
import nl.jqno.equalsverifier.Warning; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.mockito.Mockito.mock; | ||
|
||
class ContextVerifierTest { | ||
|
||
@Test | ||
void equalsContract() { | ||
EqualsVerifier | ||
.simple() | ||
.forClass(Context.class) | ||
.suppress(Warning.REFERENCE_EQUALITY) | ||
.withPrefabValues(Type.class, mock(Type.class), mock(Type.class)) | ||
.verify(); | ||
} | ||
|
||
@Test | ||
void toStringContract() { | ||
ToStringVerifier.forClass(Context.class).verify(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...rator/src/test/java/com/weedow/schemaorg/generator/core/GeneratorOptionsVerifierTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.weedow.schemaorg.generator.core; | ||
|
||
import com.jparams.verifier.tostring.ToStringVerifier; | ||
import nl.jqno.equalsverifier.EqualsVerifier; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class GeneratorOptionsVerifierTest { | ||
|
||
@Test | ||
void equalsContract() { | ||
EqualsVerifier.simple().forClass(GeneratorOptions.class).verify(); | ||
} | ||
|
||
@Test | ||
void toStringContract() { | ||
ToStringVerifier.forClass(GeneratorOptions.class).verify(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
generator/src/test/java/com/weedow/schemaorg/generator/parser/ParserOptionsVerifierTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.weedow.schemaorg.generator.parser; | ||
|
||
import com.jparams.verifier.tostring.ToStringVerifier; | ||
import nl.jqno.equalsverifier.EqualsVerifier; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ParserOptionsVerifierTest { | ||
|
||
@Test | ||
void equalsContract() { | ||
EqualsVerifier | ||
.simple() | ||
.forClass(ParserOptions.class) | ||
.verify(); | ||
} | ||
|
||
@Test | ||
void toStringContract() { | ||
ToStringVerifier.forClass(ParserOptions.class).verify(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...er/src/test/java/com/weedow/schemaorg/serializer/JsonLdSerializerOptionsVerifierTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.weedow.schemaorg.serializer; | ||
|
||
import com.jparams.verifier.tostring.ToStringVerifier; | ||
import nl.jqno.equalsverifier.EqualsVerifier; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class JsonLdSerializerOptionsVerifierTest { | ||
|
||
@Test | ||
void equalsContract() { | ||
EqualsVerifier | ||
.simple() | ||
.forClass(JsonLdSerializerOptions.class) | ||
.verify(); | ||
} | ||
|
||
@Test | ||
void toStringContract() { | ||
ToStringVerifier.forClass(JsonLdSerializerOptions.class).verify(); | ||
} | ||
} |