Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
niknetniko committed Sep 19, 2019
1 parent d34b033 commit 77bad1a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
17 changes: 8 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -113,33 +113,32 @@ dependencies {
// Network stack
// Do not upgrade beyond 3.12.x until we require API 21+
//noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:3.12.3'
implementation 'com.squareup.okhttp3:okhttp:3.12.5'
implementation 'com.squareup.moshi:moshi:1.8.0'

implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'
implementation 'net.sourceforge.streamsupport:android-retrostreams:1.7.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'

// Use our own fork, since it seems the original library is abandoned.
implementation 'com.heinrichreimersoftware:material-intro:2.0.0'
implementation 'com.jonathanfinerty.once:once:1.2.2'
implementation 'com.jonathanfinerty.once:once:1.3.0'
implementation 'com.github.captain-miao:optroundcardview:1.1.0'
implementation 'blue.aodev:material-values:1.1.1'

implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

if (props.getProperty("hydra.debug.leaks").toBoolean()) {
logger.info("Leak tracking enabled...")
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-2'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-3'
}

//Test code
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.4'
testImplementation 'org.mockito:mockito-core:3.0.0'

testImplementation 'org.robolectric:robolectric:4.3'
testImplementation 'androidx.test:core:1.2.0'
Expand All @@ -154,11 +153,11 @@ dependencies {
exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
}

testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.2'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.8'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.5'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.9'
testImplementation 'com.shazam:shazamcrest:0.11'
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
testImplementation 'io.github.benas:random-beans:3.9.0'
testImplementation 'org.jeasy:easy-random-core:4.0.0'
testImplementation 'org.apache.commons:commons-lang3:3.9'
testImplementation 'org.hamcrest:hamcrest-core:1.3'
testImplementation 'commons-validator:commons-validator:1.6'
Expand Down
39 changes: 22 additions & 17 deletions app/src/test/java/be/ugent/zeus/hydra/testing/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@
import java.util.stream.Stream;

import be.ugent.zeus.hydra.feed.cards.database.CardDaoTest;

import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;
import io.github.benas.randombeans.EnhancedRandomBuilder;
import io.github.benas.randombeans.api.Randomizer;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.EqualsVerifierApi;
import nl.jqno.equalsverifier.Warning;
import okio.BufferedSource;
import okio.Okio;
import org.jeasy.random.EasyRandom;
import org.jeasy.random.EasyRandomParameters;
import org.threeten.bp.Instant;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.ZonedDateTime;

import static org.jeasy.random.FieldPredicates.named;

/**
* General utilities and helper methods for use within the tests.
*
Expand All @@ -34,25 +35,29 @@
public class Utils {

public static <T> T generate(Class<T> clazz, String... exclude) {
return EnhancedRandomBuilder.aNewEnhancedRandomBuilder()
EasyRandomParameters params = new EasyRandomParameters()
.scanClasspathForConcreteTypes(true)
.randomize(ZonedDateTime.class, (Randomizer<ZonedDateTime>) ZonedDateTime::now)
.randomize(LocalDate.class, (Randomizer<LocalDate>) LocalDate::now)
.randomize(OffsetDateTime.class, (Randomizer<OffsetDateTime>) OffsetDateTime::now)
.randomize(Instant.class, (Randomizer<Instant>) Instant::now)
.build()
.nextObject(clazz, exclude);
.randomize(ZonedDateTime.class, ZonedDateTime::now)
.randomize(LocalDate.class, LocalDate::now)
.randomize(OffsetDateTime.class, OffsetDateTime::now)
.randomize(Instant.class, Instant::now);
for (String excluded: exclude) {
params.excludeField(named(excluded));
}
return new EasyRandom(params).nextObject(clazz);
}

public static <T> Stream<T> generate(Class<T> clazz, int amount, String... exclude) {
return EnhancedRandomBuilder.aNewEnhancedRandomBuilder()
EasyRandomParameters params = new EasyRandomParameters()
.scanClasspathForConcreteTypes(true)
.randomize(ZonedDateTime.class, (Randomizer<ZonedDateTime>) ZonedDateTime::now)
.randomize(LocalDate.class, (Randomizer<LocalDate>) LocalDate::now)
.randomize(OffsetDateTime.class, (Randomizer<OffsetDateTime>) OffsetDateTime::now)
.randomize(Instant.class, (Randomizer<Instant>) Instant::now)
.build()
.objects(clazz, amount, exclude);
.randomize(ZonedDateTime.class, ZonedDateTime::now)
.randomize(LocalDate.class, LocalDate::now)
.randomize(OffsetDateTime.class, OffsetDateTime::now)
.randomize(Instant.class, Instant::now);
for (String excluded: exclude) {
params.excludeField(named(excluded));
}
return new EasyRandom(params).objects(clazz, amount);
}

/**
Expand Down

0 comments on commit 77bad1a

Please sign in to comment.