@Override
public void perform(RestRequest restRequest, Object param) {
String title = getName();
RestMockService mockService = null;
WsdlProject project = restRequest.getOperation().getInterface().getProject();
while (mockService == null) {
if (project.getRestMockServiceCount() > 0) {
String option = promptForMockServiceSelection(title, project);
boolean userCancelled = option == null;
if (userCancelled) {
return;
}
mockService = project.getRestMockServiceByName(option);
}
if (mockService == null) {
mockService = createNewMockService(title, project);
UISupport.showDesktopPanel(mockService);
maybeStart(mockService);
}
}
addRequestToMockService(restRequest, mockService);
restRequest.getOperation().getService().addEndpoint(mockService.getLocalEndpoint());
}