### Question:
WebHookPayloadJson extends WebHookPayloadGeneric implements WebHookPayload { public void register(){ myManager.registerPayloadFormat(this); } WebHookPayloadJson(WebHookPayloadManager manager, WebHookVariableResolverManager variableResolverManager); void register(); String getFormatDescription(); String getFormatShortName(); String getFormatToolTipText(); String getContentType(); Integer getRank(); void setRank(Integer rank); String getCharset(); @Override WebHookStringRenderer getWebHookStringRenderer(); @Override PayloadTemplateEngineType getTemplateEngineType(); static final String FORMAT_SHORT_NAME; }### Answer:
@Test public void testRegister() { SBuildServer mockServer = mock(SBuildServer.class); when(mockServer.getRootUrl()).thenReturn("http: WebHookPayloadManager wpm = new WebHookPayloadManager(mockServer); WebHookPayloadJson whp = new WebHookPayloadJson(wpm, variableResolverManager); whp.register(); assertEquals(whp, wpm.getFormat(whp.getFormatShortName())); }