@Test public void testGetMd5OfPayload() { String expectedMd5 = "c9246ed8c8ab55b1c463c501c84075e6"; String expectedChangedMd5 = "f6f81062ef5f024f1912798490ba7dfc"; ConfigPayload payload = ConfigPayload.fromInstance(new SimpletypesConfig(new SimpletypesConfig.Builder())); System.out.println(payload); assertThat(ConfigUtils.getMd5(payload), is(expectedMd5)); payload.getSlime().get().setString("fabio", "bar"); System.out.println(payload); assertThat(ConfigUtils.getMd5(payload), is(expectedChangedMd5)); }
public static String getMd5(ConfigPayload payload) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { payload.serialize(baos, new JsonFormat(true)); } catch (IOException e) { throw new RuntimeException(e); } return getMd5(baos.toByteArray()); }
ConfigUtils { public static String getMd5(ConfigPayload payload) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { payload.serialize(baos, new JsonFormat(true)); } catch (IOException e) { throw new RuntimeException(e); } return getMd5(baos.toByteArray()); } }
ConfigUtils { public static String getMd5(ConfigPayload payload) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { payload.serialize(baos, new JsonFormat(true)); } catch (IOException e) { throw new RuntimeException(e); } return getMd5(baos.toByteArray()); }  }
ConfigUtils { public static String getMd5(ConfigPayload payload) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { payload.serialize(baos, new JsonFormat(true)); } catch (IOException e) { throw new RuntimeException(e); } return getMd5(baos.toByteArray()); }  static String getMd5(ConfigPayload payload); static String getMd5(String input); static String getMd5(Utf8Array input); static String getMd5(byte[] input); static String stripSpaces(String str); static String getDefMd5(List<String> lines); static String getDefNamespace(Reader in); static Tuple2<String, String> getNameAndNamespaceFromString(String nameDotNamespace); static ConfigDefinitionKey createConfigDefinitionKeyFromZKString(String nodeName); static ConfigDefinitionKey createConfigDefinitionKeyFromDefFile(File file); static String escapeConfigFormatValue(String input); static String getDefMd5FromRequest(String defMd5, List<String> defContent); static String getCanonicalHostName(); static String getEnvValue(String defaultValue, String... envVars); static boolean isGenerationNewer(long newGen, long oldGen); }
ConfigUtils { public static String getMd5(ConfigPayload payload) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { payload.serialize(baos, new JsonFormat(true)); } catch (IOException e) { throw new RuntimeException(e); } return getMd5(baos.toByteArray()); }  static String getMd5(ConfigPayload payload); static String getMd5(String input); static String getMd5(Utf8Array input); static String getMd5(byte[] input); static String stripSpaces(String str); static String getDefMd5(List<String> lines); static String getDefNamespace(Reader in); static Tuple2<String, String> getNameAndNamespaceFromString(String nameDotNamespace); static ConfigDefinitionKey createConfigDefinitionKeyFromZKString(String nodeName); static ConfigDefinitionKey createConfigDefinitionKeyFromDefFile(File file); static String escapeConfigFormatValue(String input); static String getDefMd5FromRequest(String defMd5, List<String> defContent); static String getCanonicalHostName(); static String getEnvValue(String defaultValue, String... envVars); static boolean isGenerationNewer(long newGen, long oldGen);  }