endpointSet.add(USE_CURRENT);
for (int c = 0; c < testCase.getTestStepCount(); c++) {
TestStep step = testCase.getTestStepAt(c);
if (step instanceof HttpRequestTestStep) {
HttpRequestTestStep requestStep = (HttpRequestTestStep) step;
Operation operation = requestStep.getTestRequest().getOperation();
if (operation != null) {
String[] endpoints = operation.getInterface().getEndpoints();
for (int i = 0; i < endpoints.length; i++) {
endpointSet.add(endpoints[i]);
}
}
currentEndpointSet.add(requestStep.getTestRequest().getEndpoint());
}
}
String selected = (String) UISupport.prompt("Select endpoint to set for all requests", "Set Endpoint",
endpointSet.toArray(), currentEndpointSet.size() == 1 ? currentEndpointSet.iterator().next() : USE_CURRENT);
if (selected == null || selected.equals(USE_CURRENT)) {
return;
}
int cnt = 0;
for (int c = 0; c < testCase.getTestStepCount(); c++) {
TestStep step = testCase.getTestStepAt(c);
if (step instanceof HttpRequestTestStep) {
HttpRequestTestStep requestStep = (HttpRequestTestStep) step;
TestRequest testRequest = requestStep.getTestRequest();
if (testRequest.getEndpoint() == null || !testRequest.getEndpoint().equals(selected)) {
testRequest.setEndpoint(selected);
cnt++;
}