Skip to content

Instantly share code, notes, and snippets.

@adinauer
Created May 16, 2014 06:55
Show Gist options
  • Save adinauer/d7d5f5794d6ae95c8252 to your computer and use it in GitHub Desktop.
Save adinauer/d7d5f5794d6ae95c8252 to your computer and use it in GitHub Desktop.
${is:importStatic(
org.hamcrest.Matchers.equalTo
)}
${:import(
org.hamcrest.Matcher,
org.hamcrest.FeatureMatcher
)}
public static Matcher<${type_to_match}> ${custom_matcher_name}(${type_of_expected_value} ${expected_value:expected}) {
return new FeatureMatcher<${type_to_match}, ${type_of_expected_value}>(equalTo(${expected_value}), "${expected_message} ", "${field_name}") {
@Override
protected ${type_of_expected_value} featureValueOf(${type_to_match} actual) {
return actual.${cursor};
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment