Additional matchers for Hamcrest

Additional matchers for Hamcrest: guava, bean, etc.

License

License

GroupId

GroupId

com.github.gkonst
ArtifactId

ArtifactId

hamcrest-extras
Last Version

Last Version

0.2
Release Date

Release Date

Type

Type

jar
Description

Description

Additional matchers for Hamcrest
Additional matchers for Hamcrest: guava, bean, etc.
Project URL

Project URL

https://github.com/gkonst/hamcrest-extras
Source Code Management

Source Code Management

https://github.com/gkonst/hamcrest-extras

Download hamcrest-extras

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.gkonst/hamcrest-extras/ -->
<dependency>
    <groupId>com.github.gkonst</groupId>
    <artifactId>hamcrest-extras</artifactId>
    <version>0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.gkonst/hamcrest-extras/
implementation 'com.github.gkonst:hamcrest-extras:0.2'
// https://jarcasting.com/artifacts/com.github.gkonst/hamcrest-extras/
implementation ("com.github.gkonst:hamcrest-extras:0.2")
'com.github.gkonst:hamcrest-extras:jar:0.2'
<dependency org="com.github.gkonst" name="hamcrest-extras" rev="0.2">
  <artifact name="hamcrest-extras" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.gkonst', module='hamcrest-extras', version='0.2')
)
libraryDependencies += "com.github.gkonst" % "hamcrest-extras" % "0.2"
[com.github.gkonst/hamcrest-extras "0.2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.hamcrest : hamcrest-library jar 1.3
com.google.guava : guava Optional jar 15.0

test (1)

Group / Artifact Type Version
org.testng : testng jar 6.8.7

Project Modules

There are no modules declared in this project.

hamcrest-extras

Custom Hamcrest matchers for guava, beans, etc.

Build StatusCoverage Status

Usage

The static factory methods for all matchers are generated to com.github.gkonst.hamcrest.matchers.Matchers class for easy access.

Contents

The package contains the following matchers:

  • Guava IsOptional matchers
  • isAbsent() - matches that the target Optional is not present.
  • isPresent() - matches that the target Optional is present.
  • isValue(T value) - matches that the target Optional is Some and contains value equals given value.
  • isValue(Matcher<T> matcher) - matches that the target Optional is Some and contains value matches given matcher.
  • Bean TheSameIs matcher
  • theSameIs - matches that the target bean has the same field values
  • IO matchers
  • anExistingUrl - matches that the target url exists

Versions

Version
0.2
0.1