use of jenkins.metrics.api.MetricsAccessKey in project configuration-as-code-plugin by jenkinsci.
the class EssentialsTest method essentialsTest.
@Test
@ConfiguredWithCode("EssentialsTest.yml")
public void essentialsTest() {
final Jenkins jenkins = Jenkins.get();
assertEquals("Welcome to Jenkins Essentials!", jenkins.getSystemMessage());
final ExtensionList<MetricsAccessKey.DescriptorImpl> metricsDescriptors = ExtensionList.lookup(MetricsAccessKey.DescriptorImpl.class);
assertNotNull(metricsDescriptors);
assertThat(metricsDescriptors, hasSize(1));
MetricsAccessKey.DescriptorImpl metricsDescriptor = metricsDescriptors.get(0);
final List<MetricsAccessKey> accessKeys = metricsDescriptor.getAccessKeys();
assertThat(accessKeys, hasSize(1));
MetricsAccessKey accessKey = accessKeys.get(0);
assertThat(accessKey.getKey(), is("evergreen"));
assertThat(accessKey.getDescription(), is("Key for evergreen health-check"));
assertThat(accessKey.isCanHealthCheck(), is(true));
assertThat(accessKey.isCanPing(), is(false));
assertThat(accessKey.isCanPing(), is(false));
assertThat(accessKey.isCanThreadDump(), is(false));
assertThat(accessKey.isCanMetrics(), is(false));
assertThat(accessKey.getOrigins(), is("*"));
// metricsDescriptor.g
}
Aggregations