Skip to content

Instantly share code, notes, and snippets.

@chids
Created May 23, 2014 12:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chids/54872078cce90765d487 to your computer and use it in GitHub Desktop.
Save chids/54872078cce90765d487 to your computer and use it in GitHub Desktop.
package inception.commands;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import javax.ws.rs.client.Entity;
import org.mockito.ArgumentMatcher;
public class UnfuckEntity extends ArgumentMatcher<Entity<?>> {
private final Entity<?> expected;
public UnfuckEntity(final Entity<?> expected) {
this.expected = expected;
}
@Override
public boolean matches(final Object argument) {
final Entity<?> actual = (Entity<?>)argument;
assertArrayEquals(this.expected.getAnnotations(), actual.getAnnotations());
assertEquals(this.expected.getEncoding(), actual.getEncoding());
assertEquals(this.expected.getLanguage(), actual.getLanguage());
assertEquals(this.expected.getMediaType(), actual.getMediaType());
assertEquals(this.expected.getVariant(), actual.getVariant());
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment