use of org.cloudfoundry.promregator.scanner.AppInstanceScanner in project promregator by promregator.
the class MockedMetricsEndpointSpringApplication method appInstanceScanner.
@Bean
public AppInstanceScanner appInstanceScanner() {
return new AppInstanceScanner() {
@Override
public List<Instance> determineInstancesFromTargets(List<Target> targets) {
LinkedList<Instance> result = new LinkedList<>();
Target t = new Target();
t.setOrgName("unittestorg");
t.setSpaceName("unittestspace");
t.setApplicationName("unittestapp");
t.setPath("/path");
t.setProtocol("https");
result.add(new Instance(t, "faedbb0a-2273-4cb4-a659-bd31331f7daf:0", "http://localhost:1234"));
result.add(new Instance(t, "faedbb0a-2273-4cb4-a659-bd31331f7daf:1", "http://localhost:1234"));
t = new Target();
t.setOrgName("unittestorg");
t.setSpaceName("unittestspace");
t.setApplicationName("unittestapp2");
t.setPath("/otherpath");
t.setProtocol("http");
result.add(new Instance(t, "1142a717-e27d-4028-89d8-b42a0c973300:0", "http://localhost:1235"));
return result;
}
};
}
Aggregations