From 0bba6cb5749a9bc5e39bd045da9507a1aa40cb77 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 2 Aug 2015 12:56:10 -0700 Subject: [PATCH] Updates to Feign 8.7 and MockWebServer 2.4 --- CHANGELOG.md | 1 + build.gradle | 2 +- cli/build.gradle | 4 ++-- .../cli/GeoResourceRecordSetCommands.java | 3 +-- clouddns/build.gradle | 8 ++++---- .../clouddns/KeystoneAccessAdapter.java | 2 +- core/build.gradle | 6 +++--- .../assertj/RecordedRequestAssert.java | 4 ++-- designate/build.gradle | 8 ++++---- .../designate/KeystoneV2AccessAdapter.java | 2 +- dynect/build.gradle | 8 ++++---- example-android/build.gradle | 8 ++++---- example-daemon/build.gradle | 18 +++++++++--------- .../denominatord/DenominatorDTest.java | 19 +++++++++++++++++++ model/build.gradle | 2 +- .../java/denominator/common/UtilTest.java | 2 +- route53/build.gradle | 8 ++++---- ultradns/build.gradle | 8 ++++---- .../UltraDNSGeoResourceRecordSetApi.java | 2 +- 19 files changed, 67 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cd19a0a..4e5d8d59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Version 4.6 * Decode any x509 cert or private key in CLI credentials +* Updates to Feign 8.7 and MockWebServer 2.4 ### Version 4.5 * Adds `ZoneApi.put()` and `ZoneApi.delete()` diff --git a/build.gradle b/build.gradle index 509ecf89..77aa3898 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { } plugins { - id 'nebula.netflixoss' version '2.2.9' + id 'nebula.netflixoss' version '2.2.10' } ext { diff --git a/cli/build.gradle b/cli/build.gradle index 2e4ec440..490ddde5 100644 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -20,8 +20,8 @@ dependencies { testCompile project(':denominator-model').sourceSets.test.output testCompile project(':denominator-core').sourceSets.test.output testCompile 'junit:junit:4.12' - testCompile 'com.squareup.okhttp:mockwebserver:2.2.0' - testCompile 'org.assertj:assertj-core:1.7.1' + testCompile 'com.squareup.okhttp:mockwebserver:2.4.0' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 } // create a self-contained jar that is executable diff --git a/cli/src/main/java/denominator/cli/GeoResourceRecordSetCommands.java b/cli/src/main/java/denominator/cli/GeoResourceRecordSetCommands.java index f48ef2b6..28273d49 100644 --- a/cli/src/main/java/denominator/cli/GeoResourceRecordSetCommands.java +++ b/cli/src/main/java/denominator/cli/GeoResourceRecordSetCommands.java @@ -127,8 +127,7 @@ public Iterator doRun(DNSApiManager mgr) { iterator = mgr.api().geoRecordSetsInZone(id(mgr, zoneIdOrName)) .iterateByNameAndType(name, type); - } - if (name != null) { + } else if (name != null) { iterator = mgr.api().geoRecordSetsInZone(id(mgr, zoneIdOrName)).iterateByName(name); } else { iterator = mgr.api().geoRecordSetsInZone(id(mgr, zoneIdOrName)).iterator(); diff --git a/clouddns/build.gradle b/clouddns/build.gradle index 0c7b3c8d..42c8adf6 100644 --- a/clouddns/build.gradle +++ b/clouddns/build.gradle @@ -11,11 +11,11 @@ test { dependencies { compile project(':denominator-core') - compile 'com.netflix.feign:feign-core:8.1.0' - compile 'com.netflix.feign:feign-gson:8.1.0' + compile 'com.netflix.feign:feign-core:8.7.0' + compile 'com.netflix.feign:feign-gson:8.7.0' testCompile project(':denominator-model').sourceSets.test.output testCompile project(':denominator-core').sourceSets.test.output testCompile 'junit:junit:4.12' - testCompile 'org.assertj:assertj-core:1.7.1' - testCompile 'com.squareup.okhttp:mockwebserver:2.2.0' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 + testCompile 'com.squareup.okhttp:mockwebserver:2.4.0' } diff --git a/clouddns/src/main/java/denominator/clouddns/KeystoneAccessAdapter.java b/clouddns/src/main/java/denominator/clouddns/KeystoneAccessAdapter.java index 86ad96ad..2a466247 100644 --- a/clouddns/src/main/java/denominator/clouddns/KeystoneAccessAdapter.java +++ b/clouddns/src/main/java/denominator/clouddns/KeystoneAccessAdapter.java @@ -29,7 +29,7 @@ static boolean isNull(JsonElement element) { @Override public TokenIdAndPublicURL read(JsonReader in) throws IOException { - JsonObject access = null; + JsonObject access; try { access = new JsonParser().parse(in).getAsJsonObject().get("access").getAsJsonObject(); } catch (JsonIOException e) { diff --git a/core/build.gradle b/core/build.gradle index 43878fa9..41101ace 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -16,8 +16,8 @@ test { dependencies { compile project(':denominator-model') testCompile 'junit:junit:4.12' - testCompile 'org.assertj:assertj-core:1.7.1' - testCompile 'com.squareup.okhttp:mockwebserver:2.2.0' - testCompile 'com.netflix.feign:feign-core:8.1.0' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 + testCompile 'com.squareup.okhttp:mockwebserver:2.4.0' + testCompile 'com.netflix.feign:feign-core:8.7.0' testCompile project(':denominator-model').sourceSets.test.output } diff --git a/core/src/test/java/denominator/assertj/RecordedRequestAssert.java b/core/src/test/java/denominator/assertj/RecordedRequestAssert.java index aae64162..ac191e20 100644 --- a/core/src/test/java/denominator/assertj/RecordedRequestAssert.java +++ b/core/src/test/java/denominator/assertj/RecordedRequestAssert.java @@ -30,14 +30,14 @@ public RecordedRequestAssert hasPath(String expected) { public RecordedRequestAssert hasBody(String utf8Expected) { isNotNull(); - objects.assertEqual(info, actual.getUtf8Body(), utf8Expected); + objects.assertEqual(info, actual.getBody().readUtf8(), utf8Expected); return this; } public RecordedRequestAssert hasXMLBody(String utf8Expected) { isNotNull(); hasHeaderContaining("Content-Type", "application/xml"); - strings.assertXmlEqualsTo(info, actual.getUtf8Body(), utf8Expected); + strings.assertXmlEqualsTo(info, actual.getBody().readUtf8(), utf8Expected); return this; } diff --git a/designate/build.gradle b/designate/build.gradle index a75bde1b..76bcf398 100644 --- a/designate/build.gradle +++ b/designate/build.gradle @@ -12,11 +12,11 @@ test { dependencies { compile project(':denominator-core') - compile 'com.netflix.feign:feign-core:8.1.0' - compile 'com.netflix.feign:feign-gson:8.1.0' + compile 'com.netflix.feign:feign-core:8.7.0' + compile 'com.netflix.feign:feign-gson:8.7.0' testCompile project(':denominator-model').sourceSets.test.output testCompile project(':denominator-core').sourceSets.test.output testCompile 'junit:junit:4.12' - testCompile 'org.assertj:assertj-core:1.7.1' - testCompile 'com.squareup.okhttp:mockwebserver:2.2.0' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 + testCompile 'com.squareup.okhttp:mockwebserver:2.4.0' } diff --git a/designate/src/main/java/denominator/designate/KeystoneV2AccessAdapter.java b/designate/src/main/java/denominator/designate/KeystoneV2AccessAdapter.java index 0d2e8e33..81c7b52a 100644 --- a/designate/src/main/java/denominator/designate/KeystoneV2AccessAdapter.java +++ b/designate/src/main/java/denominator/designate/KeystoneV2AccessAdapter.java @@ -22,7 +22,7 @@ static boolean isNull(JsonElement element) { @Override public TokenIdAndPublicURL read(JsonReader in) throws IOException { - JsonObject access = null; + JsonObject access; try { access = new JsonParser().parse(in).getAsJsonObject().get("access").getAsJsonObject(); } catch (JsonIOException e) { diff --git a/dynect/build.gradle b/dynect/build.gradle index dedfa57b..f9d65b2e 100644 --- a/dynect/build.gradle +++ b/dynect/build.gradle @@ -12,11 +12,11 @@ test { dependencies { compile project(':denominator-core') - compile 'com.netflix.feign:feign-core:8.1.0' - compile 'com.netflix.feign:feign-gson:8.1.0' + compile 'com.netflix.feign:feign-core:8.7.0' + compile 'com.netflix.feign:feign-gson:8.7.0' testCompile project(':denominator-model').sourceSets.test.output testCompile project(':denominator-core').sourceSets.test.output testCompile 'junit:junit:4.12' - testCompile 'org.assertj:assertj-core:1.7.1' - testCompile 'com.squareup.okhttp:mockwebserver:2.2.0' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 + testCompile 'com.squareup.okhttp:mockwebserver:2.4.0' } diff --git a/example-android/build.gradle b/example-android/build.gradle index 9399cd82..a5a9b987 100644 --- a/example-android/build.gradle +++ b/example-android/build.gradle @@ -4,7 +4,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:1.1.3' + classpath 'com.android.tools.build:gradle:1.3.0' } } @@ -30,11 +30,11 @@ repositories { mavenLocal() dependencies { compile 'com.android.support:support-v4:19.0.0' - compile 'com.netflix.denominator:denominator-core:4.5.0' + compile 'com.netflix.denominator:denominator-core:4.5.1' // swap this out to use a different provider - compile 'com.netflix.denominator:denominator-ultradns:4.5.0' + compile 'com.netflix.denominator:denominator-ultradns:4.5.1' // TODO: find a way to have this in compile classpath, but not in apk compile 'com.squareup.dagger:dagger-compiler:1.2.2' compile 'com.squareup:tape:1.2.3' - compile 'com.squareup:otto:1.3.6' + compile 'com.squareup:otto:1.3.8' } diff --git a/example-daemon/build.gradle b/example-daemon/build.gradle index 39e0179b..80872102 100644 --- a/example-daemon/build.gradle +++ b/example-daemon/build.gradle @@ -5,19 +5,19 @@ repositories { mavenLocal() mavenCentral() } dependencies { - compile 'com.netflix.denominator:denominator-core:4.5.0' - compile 'com.netflix.denominator:denominator-dynect:4.5.0' - compile 'com.netflix.denominator:denominator-ultradns:4.5.0' - compile 'com.netflix.denominator:denominator-route53:4.5.0' - compile 'com.netflix.denominator:denominator-clouddns:4.5.0' - compile 'com.netflix.feign:feign-core:8.1.0' - compile ('com.squareup.okhttp:mockwebserver:2.3.0') { + compile 'com.netflix.denominator:denominator-core:4.5.1' + compile 'com.netflix.denominator:denominator-dynect:4.5.1' + compile 'com.netflix.denominator:denominator-ultradns:4.5.1' + compile 'com.netflix.denominator:denominator-route53:4.5.1' + compile 'com.netflix.denominator:denominator-clouddns:4.5.1' + compile 'com.netflix.feign:feign-core:8.7.0' + compile ('com.squareup.okhttp:mockwebserver:2.4.0') { exclude group: 'org.bouncycastle' } compile 'com.google.code.gson:gson:2.2.4' testCompile 'junit:junit:4.12' - testCompile 'org.assertj:assertj-core:1.7.1' - testCompile 'com.netflix.feign:feign-gson:8.1.0' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 + testCompile 'com.netflix.feign:feign-gson:8.7.0' } // create a self-contained jar that is executable diff --git a/example-daemon/src/test/java/denominator/denominatord/DenominatorDTest.java b/example-daemon/src/test/java/denominator/denominatord/DenominatorDTest.java index 9e520f16..eea9d58b 100644 --- a/example-daemon/src/test/java/denominator/denominatord/DenominatorDTest.java +++ b/example-daemon/src/test/java/denominator/denominatord/DenominatorDTest.java @@ -46,6 +46,25 @@ public static void start() throws IOException { .encoder(new GsonEncoder()) .decoder(new GsonDecoder()) .target(DenominatorDApi.class, "http://localhost:" + port); + + mock.api().basicRecordSetsInZone("denominator.io.").put(ResourceRecordSet.builder() + .name("www.denominator.io.") + .type("A") + .add(AData.create("192.0.2.1")).build()); + + mock.api().weightedRecordSetsInZone("denominator.io.").put(ResourceRecordSet.builder() + .name("www.weighted.denominator.io.") + .type("CNAME") + .qualifier("EU-West") + .weighted(Weighted.create(1)) + .add(CNAMEData.create("www1.denominator.io.")).build()); + + mock.api().weightedRecordSetsInZone("denominator.io.").put(ResourceRecordSet.builder() + .name("www.weighted.denominator.io.") + .type("CNAME") + .qualifier("US-West") + .weighted(Weighted.create(1)) + .add(CNAMEData.create("www2.denominator.io.")).build()); } @AfterClass diff --git a/model/build.gradle b/model/build.gradle index 11e4d6ec..90f2d7f9 100644 --- a/model/build.gradle +++ b/model/build.gradle @@ -5,5 +5,5 @@ sourceCompatibility = 1.6 dependencies { testCompile 'junit:junit:4.12' - testCompile 'org.assertj:assertj-core:1.7.1' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 } diff --git a/model/src/test/java/denominator/common/UtilTest.java b/model/src/test/java/denominator/common/UtilTest.java index ddc4e3f9..da30da38 100644 --- a/model/src/test/java/denominator/common/UtilTest.java +++ b/model/src/test/java/denominator/common/UtilTest.java @@ -20,8 +20,8 @@ import static denominator.common.Util.peekingIterator; import static denominator.common.Util.slurp; import static denominator.common.Util.split; -import static junit.framework.Assert.assertFalse; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class UtilTest { diff --git a/route53/build.gradle b/route53/build.gradle index 99f24139..c3a5f068 100644 --- a/route53/build.gradle +++ b/route53/build.gradle @@ -11,11 +11,11 @@ test { dependencies { compile project(':denominator-core') - compile 'com.netflix.feign:feign-core:8.1.0' - compile 'com.netflix.feign:feign-sax:8.1.0' + compile 'com.netflix.feign:feign-core:8.7.0' + compile 'com.netflix.feign:feign-sax:8.7.0' testCompile project(':denominator-model').sourceSets.test.output testCompile project(':denominator-core').sourceSets.test.output testCompile 'junit:junit:4.12' - testCompile 'org.assertj:assertj-core:1.7.1' - testCompile 'com.squareup.okhttp:mockwebserver:2.2.0' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 + testCompile 'com.squareup.okhttp:mockwebserver:2.4.0' } diff --git a/ultradns/build.gradle b/ultradns/build.gradle index 669d04f3..7c737411 100644 --- a/ultradns/build.gradle +++ b/ultradns/build.gradle @@ -11,11 +11,11 @@ test { dependencies { compile project(':denominator-core') - compile 'com.netflix.feign:feign-core:8.1.0' - compile 'com.netflix.feign:feign-sax:8.1.0' + compile 'com.netflix.feign:feign-core:8.7.0' + compile 'com.netflix.feign:feign-sax:8.7.0' testCompile project(':denominator-model').sourceSets.test.output testCompile project(':denominator-core').sourceSets.test.output testCompile 'junit:junit:4.12' - testCompile 'org.assertj:assertj-core:1.7.1' - testCompile 'com.squareup.okhttp:mockwebserver:2.2.0' + testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7 + testCompile 'com.squareup.okhttp:mockwebserver:2.4.0' } diff --git a/ultradns/src/main/java/denominator/ultradns/UltraDNSGeoResourceRecordSetApi.java b/ultradns/src/main/java/denominator/ultradns/UltraDNSGeoResourceRecordSetApi.java index 1b5db653..2fb00d70 100644 --- a/ultradns/src/main/java/denominator/ultradns/UltraDNSGeoResourceRecordSetApi.java +++ b/ultradns/src/main/java/denominator/ultradns/UltraDNSGeoResourceRecordSetApi.java @@ -208,7 +208,7 @@ public void put(ResourceRecordSet rrset) { if (!recordsLeftToCreate.isEmpty()) { // shotgun create - String poolId = null; + String poolId; try { String type = rrset.type(); if ("CNAME".equals(type)) {