JobAction implements Action, AsyncTrendChart { @Override public String getDisplayName() { return labelProvider.getLinkName(); } @Deprecated  JobAction(final Job<?, ?> owner, final StaticAnalysisLabelProvider labelProvider);  JobAction(final Job<?, ?> owner, final StaticAnalysisLabelProvider labelProvider, final int numberOfTools);  JobAction(final Job<?, ?> owner, final StaticAnalysisLabelProvider labelProvider, final int numberOfTools,
            final TrendChartType trendChartType); String getId(); @Override String getDisplayName(); String getTrendName(); Job<?, ?> getOwner(); History createBuildHistory(); @Override @CheckForNull String getIconFileName(); @Override String getUrlName(); @SuppressWarnings("unused") // Called by jelly view void doIndex(final StaplerRequest request, final StaplerResponse response); Optional<ResultAction> getLatestAction(); @JavaScriptMethod @Override String getBuildTrendModel(); @SuppressWarnings("unused") // Called by jelly view @Override boolean isTrendVisible(); @Override String toString();  }
@Test void shouldUseLabelProviderLinkNameAsDisplayName() { Job<?, ?> job = mock(Job.class); StaticAnalysisLabelProvider labelProvider = mock(StaticAnalysisLabelProvider.class); when(labelProvider.getLinkName()).thenReturn(LINK_NAME); JobAction action = new JobAction(job, labelProvider, 1); assertThat(action.getDisplayName()).isEqualTo(LINK_NAME); }