use of com.yahoo.vespa.hosted.controller.api.integration.chef.Chef in project vespa by vespa-engine.
the class MetricsReporterTest method createReporter.
private MetricsReporter createReporter(Clock clock, Controller controller, MetricsMock metricsMock, SystemName system) {
Chef client = Mockito.mock(Chef.class);
PartialNodeResult result;
try {
result = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false).readValue(testData.resolve("chef_output.json").toFile(), PartialNodeResult.class);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
when(client.partialSearchNodes(anyString(), anyListOf(AttributeMapping.class))).thenReturn(result);
return new MetricsReporter(controller, metricsMock, client, clock, new JobControl(new MockCuratorDb()), system);
}
Aggregations