diff options
author | Harald Musum <musum@yahooinc.com> | 2021-09-15 22:23:03 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2021-09-15 22:23:03 +0200 |
commit | d720d98e1c6b9ce70d9a2b516c01da0d59857477 (patch) | |
tree | f5e1c5541c25dad068c5cde978b96bcd646c590e /config/src/test/java/com/yahoo | |
parent | b998d5f0db4d88db85e055e8985d70af3d3453a0 (diff) |
More cleanup of md5 usage
Diffstat (limited to 'config/src/test/java/com/yahoo')
-rw-r--r-- | config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestV3Test.java | 10 | ||||
-rw-r--r-- | config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestV3Test.java b/config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestV3Test.java index b1ed3a089ae..f7216058cf5 100644 --- a/config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestV3Test.java +++ b/config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestV3Test.java @@ -108,9 +108,9 @@ public class JRTConfigRequestV3Test { serverReq.addOkResponse(payload, 999999, false, PayloadChecksums.fromPayload(payload)); serverReq.addErrorResponse(ErrorCode.OUTDATED_CONFIG, "error message"); JRTClientConfigRequest next = clientReq.nextRequest(6); - // Should use config md5 and generation from the request, not the response - // when there are errors - assertThat(next.getRequestConfigMd5(), is(clientReq.getRequestConfigMd5())); + // Should use config checksums and generation from the request (not the response) when there are errors + assertThat(next.getRequestConfigChecksums().getForType(MD5), is(clientReq.getRequestConfigChecksums().getForType(MD5))); + assertThat(next.getRequestConfigChecksums().getForType(XXHASH64), is(clientReq.getRequestConfigChecksums().getForType(XXHASH64))); assertThat(next.getRequestGeneration(), is(clientReq.getRequestGeneration())); } @@ -118,12 +118,14 @@ public class JRTConfigRequestV3Test { public void ok_response_is_added() { Payload payload = createPayload("vale"); String md5 = ConfigUtils.getMd5(payload.getData()); + String xxhash64 = ConfigUtils.getXxhash64(payload.getData()); long generation = 4L; serverReq.addOkResponse(payload, generation, false, PayloadChecksums.fromPayload(payload)); assertTrue(clientReq.validateResponse()); assertThat(clientReq.getNewPayload().withCompression(CompressionType.UNCOMPRESSED).getData().toString(), is(payload.getData().toString())); assertThat(clientReq.getNewGeneration(), is(4L)); - assertThat(clientReq.getNewConfigMd5(), is(md5)); + assertThat(clientReq.getNewChecksums().getForType(MD5).asString(), is(md5)); + assertThat(clientReq.getNewChecksums().getForType(XXHASH64).asString(), is(xxhash64)); assertTrue(clientReq.hasUpdatedConfig()); assertTrue(clientReq.hasUpdatedGeneration()); } diff --git a/config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java b/config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java index 0276f3c4f1c..68f7e2b48fd 100644 --- a/config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java +++ b/config/src/test/java/com/yahoo/vespa/config/util/ConfigUtilsTest.java @@ -76,7 +76,7 @@ public class ConfigUtilsTest { String md5 = getMd5(lines); assertThat(md5, is(not(expectedMd5))); - // Check that added characters aft comment character in string leads to a different md5 than above + // Check that added characters after comment character in string leads to a different md5 than above lines.add("foo=\"1#hello and some more and even more\""); assertThat(getMd5(lines), is(not(md5))); } |