DeploymentCompleteAsyncBuildTrigger extends CustomAsyncBuildTrigger<DeploymentCompleteSpec> { @NotNull public BuildTriggerException makeTriggerException(@NotNull Throwable throwable) { throw new BuildTriggerException(displayName + " failed with error: " + throwable.getMessage(), throwable); } DeploymentCompleteAsyncBuildTrigger(String displayName, AnalyticsTracker analyticsTracker, CacheManager cacheManager, MetricRegistry metricRegistry, BuildTriggerProperties buildTriggerProperties); @NotNull BuildTriggerException makeTriggerException(@NotNull Throwable throwable); @NotNull String getRequestorString(@NotNull DeploymentCompleteSpec deploymentCompleteSpec); int getPollIntervalInMilliseconds(); @NotNull CustomCheckJob<DeploymentCompleteSpec> createJob(@NotNull String buildType, @NotNull CustomDataStorage dataStorage, @NotNull Map<String, String> properties, @NotNull UUID correlationId); @NotNull CheckResult<DeploymentCompleteSpec> createCrashOnSubmitResult(@NotNull Throwable throwable, UUID correlationId); String describeTrigger(BuildTriggerDescriptor buildTriggerDescriptor); Map<String, String> getProperties(DeploymentCompleteSpec deploymentCompleteSpec);  }
@Test(expectedExceptions = BuildTriggerException.class, expectedExceptionsMessageRegExp = "the display name failed with error: the exception message") public void make_trigger_exception_throws_build_trigger_exception() { String displayName = "the display name"; DeploymentCompleteAsyncBuildTrigger sut = new DeploymentCompleteAsyncBuildTrigger(displayName, new FakeAnalyticsTracker(), new FakeCacheManager(), new FakeMetricRegistry(), new FakeBuildTriggerProperties()); sut.makeTriggerException(new ParseException("the exception message")); }