Bumped dependency versions

This commit is contained in:
2017-04-03 18:21:08 +02:00
parent 7185acbbad
commit dca0330a7c
13 changed files with 41 additions and 42 deletions

View File

@ -24,10 +24,10 @@ artifacts {
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.12'
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'ch.dissem.msgpack:msgpack:1.0.0'
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.mockito:mockito-core:2.7.21'
testCompile project(':cryptography-bc')
}

View File

@ -32,7 +32,7 @@ import static ch.dissem.bitmessage.entity.Plaintext.Type.MSG;
import static ch.dissem.bitmessage.utils.TestUtils.RANDOM;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

View File

@ -19,38 +19,27 @@ package ch.dissem.bitmessage.utils;
import ch.dissem.bitmessage.entity.ObjectMessage;
import ch.dissem.bitmessage.entity.Plaintext;
import ch.dissem.bitmessage.entity.payload.ObjectType;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.mockito.Matchers;
import org.mockito.ArgumentMatcher;
import org.mockito.ArgumentMatchers;
/**
* @author Christian Basler
*/
public class MessageMatchers {
public static Plaintext plaintext(final Plaintext.Type type) {
return Matchers.argThat(new BaseMatcher<Plaintext>() {
return ArgumentMatchers.argThat(new ArgumentMatcher<Plaintext>() {
@Override
public boolean matches(Object item) {
return item instanceof Plaintext && ((Plaintext) item).getType() == type;
}
@Override
public void describeTo(Description description) {
description.appendText("type should be ").appendValue(type);
public boolean matches(Plaintext item) {
return item != null && item.getType() == type;
}
});
}
public static ObjectMessage object(final ObjectType type) {
return Matchers.argThat(new BaseMatcher<ObjectMessage>() {
return ArgumentMatchers.argThat(new ArgumentMatcher<ObjectMessage>() {
@Override
public boolean matches(Object item) {
return item instanceof ObjectMessage && ((ObjectMessage) item).getPayload().getType() == type;
}
@Override
public void describeTo(Description description) {
description.appendText("payload type should be ").appendValue(type);
public boolean matches(ObjectMessage item) {
return item != null && item.getPayload().getType() == type;
}
});
}