private SoapOperation createSoapOperation(String portId, String name) { SoapOperation soapOperation = new SoapOperation(); soapOperation.setName(name); soapOperation.setPortId(portId); return soapOperation; }
createSoapOperationIdentifier(outputMessagePart, namespaces); final SoapOperation soapOperation = new SoapOperation();
public static SoapOperation generateSoapOperation(){ final SoapOperation soapOperation = new SoapOperation(); soapOperation.setId("SOAP OPERATION"); soapOperation.setName("Soap operation name"); soapOperation.setCurrentResponseSequenceIndex(1); soapOperation.setDefaultBody("Default body"); soapOperation.setForwardedEndpoint("Forwarded event"); soapOperation.setInvokeAddress("Invoke address"); soapOperation.setOriginalEndpoint("Original endpoint"); soapOperation.setHttpMethod(HttpMethod.POST); soapOperation.setStatus(SoapOperationStatus.MOCKED); soapOperation.setSoapVersion(SoapVersion.SOAP11); soapOperation.setIdentifyStrategy(SoapOperationIdentifyStrategy.ELEMENT_NAMESPACE); soapOperation.setMockResponses(new ArrayList<SoapMockResponse>()); return soapOperation; } }
private SoapOperation createSoapOperation(String portId, HttpMethod method, SoapVersion soapVersion, String identifierName, String namespace) { SoapOperation soapOperation = new SoapOperation(); soapOperation.setPortId(portId); soapOperation.setHttpMethod(method); soapOperation.setSoapVersion(soapVersion); soapOperation.setIdentifyStrategy(SoapOperationIdentifyStrategy.ELEMENT_NAMESPACE); SoapOperationIdentifier soapOperationIdentifier = new SoapOperationIdentifier(); soapOperationIdentifier.setName(identifierName); soapOperationIdentifier.setNamespace(namespace); soapOperation.setOperationIdentifier(soapOperationIdentifier); return soapOperation; }
@Test public void testServiceFunctionalityUpdateEndpoint() throws Exception { final String projectId = "projectId"; final String portId = "portId"; final String[] soapOperationIds = {"Operation1", "Operation2"}; final SoapOperation soapOperation1 = new SoapOperation(); soapOperation1.setId("SoapOperation1"); final SoapOperation soapOperation2 = new SoapOperation(); soapOperation2.setId("SoapOperation2"); Mockito.when(serviceProcessor.process(Mockito.any(ReadSoapOperationInput.class))) .thenReturn(ReadSoapOperationOutput.builder().operation(soapOperation1).build()) .thenReturn(ReadSoapOperationOutput.builder().operation(soapOperation2).build()); final List<SoapOperation> operations = Arrays.asList(soapOperation1, soapOperation2); final SoapOperationModifierCommand command = new SoapOperationModifierCommand(); command.setSoapOperationIds(soapOperationIds); command.setSoapOperationStatus("ENABLED"); final MockHttpServletRequestBuilder message = MockMvcRequestBuilders.post(SERVICE_URL + PROJECT + SLASH + projectId + SLASH + PORT + SLASH + portId) .param("action", "update-endpoint").flashAttr("command", command); mockMvc.perform(message) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.model().size(4 + GLOBAL_VIEW_MODEL_COUNT)) .andExpect(MockMvcResultMatchers.forwardedUrl(INDEX)) .andExpect(MockMvcResultMatchers.model().attribute(PARTIAL, UPDATE_SOAP_OPERATIONS_ENDPOINT_PAGE)) .andExpect(MockMvcResultMatchers.model().attribute(SOAP_PROJECT_ID, projectId)) .andExpect(MockMvcResultMatchers.model().attribute(SOAP_PORT_ID, portId)) .andExpect(MockMvcResultMatchers.model().attribute(SOAP_OPERATIONS, operations)) .andExpect(MockMvcResultMatchers.model().attributeExists(UPDATE_SOAP_OPERATIONS_ENDPOINT_COMMAND)); Mockito.verify(serviceProcessor, Mockito.times(2)).process(Mockito.isA(ReadSoapOperationInput.class)); }
final SoapOperation soapOperation = new SoapOperation(); soapOperation.setCurrentResponseSequenceIndex(0); soapOperation.setForwardedEndpoint(FORWARD_ENDPOINT);
SoapOperation operation = new SoapOperation(); operation.setId(operationV1.getId()); operation.setName(operationV1.getName());