### Question:
WebHookListener extends BuildServerAdapter { public void register(){ myBuildServer.addListener(this); Loggers.SERVER.debug(WEB_HOOK_LISTENER + "Registering"); } WebHookListener(SBuildServer sBuildServer, WebHookSettingsManager settings, 
    						WebHookMainSettings configSettings, WebHookTemplateManager manager,
    						WebHookFactory factory, WebHookTemplateResolver resolver,
    						WebHookContentBuilder contentBuilder, WebHookHistoryRepository historyRepository,
    						WebHookHistoryItemFactory historyItemFactory,
    						WebHookExecutor executor); void register(); @Override void buildStarted(SRunningBuild sRunningBuild); @Override void changesLoaded(SRunningBuild sRunningBuild); @Override void buildFinished(SRunningBuild sRunningBuild); @Override void buildInterrupted(SRunningBuild sRunningBuild); @Override void beforeBuildFinish(SRunningBuild sRunningBuild); @Override void responsibleChanged(
			SProject project,
			Collection<TestName> testNames, 
			ResponsibilityEntry entry,
			boolean isUserAction); @Override void responsibleChanged(@NotNull SBuildType sBuildType,
            @NotNull ResponsibilityEntry responsibilityEntryOld,
            @NotNull ResponsibilityEntry responsibilityEntryNew); @Override void responsibleChanged(
			@NotNull SProject project,
            @NotNull Collection<BuildProblemInfo> buildProblems,
            @Nullable ResponsibilityEntry entry); @Override void responsibleRemoved(
			SProject project, 
			TestNameResponsibilityEntry entry); @Override void buildProblemsChanged(SBuild build, List<BuildProblemData> before, List<BuildProblemData> after); @Override void buildTypeAddedToQueue(SQueuedBuild queuedBuild); @Override void buildRemovedFromQueue(SQueuedBuild queuedBuild, User user, String comment); @Override void buildPinned(SBuild build, User user, String comment); @Override void buildUnpinned(SBuild build, User user, String comment); @Override void serverStartup(); static final String WEBHOOKS_SETTINGS_ATTRIBUTE_NAME; }### Answer:
@Test public void testRegister() { WebHookListener whl = new WebHookListener(sBuildServer, settings,configSettings, templateManager, factory, templateResolver, contentBuilder, historyRepository, historyItemFactory, webHookExecutor); whl.register(); verify(sBuildServer).addListener(whl); }
@Test @Ignore public void testBuildChangedStatusSRunningBuildStatusStatus() throws FileNotFoundException, IOException { MockSBuildType sBuildType = new MockSBuildType("Test Build", "A Test Build", "bt1"); sBuildType.setProject(sProject); String triggeredBy = "SubVersion"; MockSRunningBuild sRunningBuild = new MockSRunningBuild(sBuildType, triggeredBy, Status.NORMAL, "Running", "TestBuild01"); when(settings.getSettings(sRunningBuild.getProjectId())).thenReturn(projSettings); MockSProject sProject = new MockSProject("Test Project", "A test project", "project1", "ATestProject", sBuildType); sBuildType.setProject(sProject); WebHookListener whl = new WebHookListener(sBuildServer, settings,configSettings, templateManager, factory, templateResolver, contentBuilder, historyRepository, historyItemFactory, webHookExecutor); Status oldStatus = Status.NORMAL; Status newStatus = Status.FAILURE; whl.register(); whl.buildChangedStatus(sRunningBuild, oldStatus, newStatus); verify(factory.getWebHook(webHookConfig,null), times(0)).post(); }