Skip to content

kishibashi3/entity-matcher

Repository files navigation

CircleCI

entity matcher

EntityMatcher is a hamcrest custom matcher to test any model classes.

AssertModel<Model> is mark interface to indicate the class is an AssertModel of Model.

usage

  1. create AssertModel class to assert {@code } class.
  2. implements AsertModel<Model>
  3. add all fields of model class to assert to.
  4. assertModel's field type is same as model's field type or Matcher of model's field type.
  5. if field type is primitive, assertModel's field can determine as the boxing type.
  6. each field can assert by equals, compare, regex, or any matcher. set @AssertFields(rule=Rule.?).
  7. if field is null, assert null as a value. if skip assertion, set @AssertField(skipIfNull=true).

dependency

usage

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published