summaryrefslogtreecommitdiffstats
path: root/documentapi/src/test
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2016-11-15 16:46:06 +0100
committerTor Brede Vekterli <vekterli@yahoo-inc.com>2016-11-15 16:46:06 +0100
commit98d6d76bf1059655a1c7adf4b4b911c0b397e510 (patch)
treece76121cc9377be93d64821c208740d7d1a4542e /documentapi/src/test
parente6af0a305f8d5c4312b733b79215b1040dfd704e (diff)
Add missing DocumentProtocol error name printing
Diffstat (limited to 'documentapi/src/test')
-rw-r--r--documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/ErrorCodesTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/ErrorCodesTest.java b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/ErrorCodesTest.java
index 16a6347d2ad..dbafd4e2f87 100644
--- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/ErrorCodesTest.java
+++ b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/ErrorCodesTest.java
@@ -83,4 +83,14 @@ public class ErrorCodesTest {
codes.put("ERROR_STALE_TIMESTAMP", DocumentProtocol.ERROR_STALE_TIMESTAMP);
codes.put("ERROR_SUSPENDED", DocumentProtocol.ERROR_SUSPENDED);
}
+
+ @Test
+ public void getErrorNameIsDefinedForAllKnownProtocolErrorCodes() {
+ final NamedErrorCodes codes = new NamedErrorCodes();
+ enumerateAllDocumentProtocolErrorCodes(codes);
+ codes.nameAndCode.entrySet().forEach(kv -> {
+ // Error names are not prefixed by "ERROR_" unlike their enum counterparts.
+ assertEquals(kv.getKey(), "ERROR_" + DocumentProtocol.getErrorName(kv.getValue()));
+ });
+ }
}