Created
May 23, 2014 12:31
-
-
Save chids/54872078cce90765d487 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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