Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Model Tester is a utility for automatically testing model classes.

License

NotificationsYou must be signed in to change notification settings

joutvhu/model-tester

Repository files navigation

Model Tester is a utility for automatically testing model classes.

Installation

  • If you are using Gradle just add the following dependency to yourbuild.gradle.
testImplementation"com.github.joutvhu:model-tester:1.0.5"
  • Or add the following dependency to yourpom.xml if you are using Maven.
<dependency>    <groupId>com.github.joutvhu</groupId>    <artifactId>model-tester</artifactId>    <version>1.0.5</version>    <scope>test</scope></dependency>

How to use?

  • Provide model class to be used for testing.
  • Set up test options.
  • Use methodtest() ortestAndThrows() to execute the tester.
publicclassUserTest {@Testpublicvoidtest_all() {Assertions.assertTrue(ModelTester.allOf(User.class).test());    }@Testpublicvoidtest_and_throws() {ModelTester.allOf(User.class).testAndThrows();    }@Testpublicvoidtest_safe() {ModelTester.safeOf(User.class).testAndThrows();    }@Testpublicvoidtest_custom() {ModelTester.of(User.class)                .constructors()                .exclude("getId","setId")                .equalsMethod()                .hashCodeMethod()                .toStringMethod()                .testAndThrows();    }}

About

Model Tester is a utility for automatically testing model classes.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Languages


[8]ページ先頭

©2009-2025 Movatter.jp