congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SoapOperation.setDefaultMockResponseId
Code IndexAdd Tabnine to your IDE (free)

How to use
setDefaultMockResponseId
method
in
com.castlemock.core.mock.soap.model.project.domain.SoapOperation

Best Java code snippets using com.castlemock.core.mock.soap.model.project.domain.SoapOperation.setDefaultMockResponseId (Showing top 4 results out of 315)

origin: castlemock/castlemock

@Test
public void testMockedXpathDefaultResponse(){
  // Input
  final HttpServletRequest httpServletRequest = getMockedHttpServletRequest(REQUEST_BODY);
  final HttpServletResponse httpServletResponse = getHttpServletResponse();
  final SoapOperation soapOperation = getSoapOperation();
  soapOperation.setDefaultResponseName("Mocked response");
  soapOperation.setDefaultMockResponseId("MockResponseId");
  soapOperation.setResponseStrategy(SoapResponseStrategy.XPATH_INPUT);
  final IdentifySoapOperationOutput identifySoapOperationOutput = IdentifySoapOperationOutput.builder()
      .projectId(PROJECT_ID)
      .portId(SOAP_PORT_ID)
      .operationId(SOAP_OPERATION_ID)
      .operation(soapOperation)
      .build();
  when(serviceProcessor.process(any(IdentifySoapOperationInput.class))).thenReturn(identifySoapOperationOutput);
  when(httpServletRequest.getRequestURI()).thenReturn(CONTEXT + SLASH + MOCK + SLASH + SOAP + SLASH + PROJECT +
      SLASH + PROJECT_ID + SLASH + SOAP_PORT_ID);
  final ResponseEntity responseEntity = soapServiceController.postMethod(PROJECT_ID, httpServletRequest, httpServletResponse);
  Assert.assertEquals(RESPONSE_BODY, responseEntity.getBody());
  Assert.assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
  Assert.assertEquals(true, responseEntity.getHeaders().containsKey(CONTENT_TYPE_HEADER));
  Assert.assertEquals(true, responseEntity.getHeaders().containsKey(ACCEPT_HEADER));
  Assert.assertEquals(APPLICATION_XML, responseEntity.getHeaders().get(CONTENT_TYPE_HEADER).get(0));
  Assert.assertEquals(APPLICATION_XML, responseEntity.getHeaders().get(ACCEPT_HEADER).get(0));
}
origin: castlemock/castlemock

@Test
public void testProcessWithDefaultXPathResponse(){
  final SoapOperation operation = SoapOperationGenerator.generateSoapOperation();
  final SoapMockResponse mockResponse = SoapMockResponseGenerator.generateSoapMockResponse();
  final String projectId = "SOAP PROJECT";
  final String portId = "SOAP PORT";
  operation.setDefaultMockResponseId(mockResponse.getId());
  final ReadSoapOperationInput input = ReadSoapOperationInput.builder()
      .projectId(projectId)
      .portId(portId)
      .operationId(operation.getId())
      .build();
  final ServiceTask<ReadSoapOperationInput> serviceTask = new ServiceTask<ReadSoapOperationInput>(input);
  Mockito.when(operationRepository.findOne(operation.getId())).thenReturn(operation);
  Mockito.when(mockResponseRepository.findWithOperationId(operation.getId())).thenReturn(Arrays.asList(mockResponse));
  final ServiceResult<ReadSoapOperationOutput> result = service.process(serviceTask);
  Mockito.verify(operationRepository, Mockito.times(1)).findOne(operation.getId());
  Mockito.verify(mockResponseRepository, Mockito.times(1)).findWithOperationId(operation.getId());
  Assert.assertNotNull(result.getOutput());
  Assert.assertEquals(operation, result.getOutput().getOperation());
  Assert.assertEquals(mockResponse.getName(), operation.getDefaultResponseName());
}
origin: castlemock/castlemock

operation.setDefaultMockResponseId(operation.getDefaultXPathMockResponseId());
operation.setDefaultXPathMockResponseId(null);
origin: castlemock/castlemock

  /**
   * The process message is responsible for processing an incoming serviceTask and generate
   * a response based on the incoming serviceTask input
   * @param serviceTask The serviceTask that will be processed by the service
   * @return A result based on the processed incoming serviceTask
   * @see ServiceTask
   * @see ServiceResult
   */
  @Override
  public ServiceResult<UpdateSoapOperationOutput> process(final ServiceTask<UpdateSoapOperationInput> serviceTask) {
    final UpdateSoapOperationInput input = serviceTask.getInput();
    final SoapOperation updated = input.getOperation();
    final SoapOperation soapOperation = this.operationRepository.findOne(input.getOperationId());

    soapOperation.setStatus(updated.getStatus());
    soapOperation.setForwardedEndpoint(updated.getForwardedEndpoint());
    soapOperation.setResponseStrategy(updated.getResponseStrategy());
    soapOperation.setSimulateNetworkDelay(updated.getSimulateNetworkDelay());
    soapOperation.setNetworkDelay(updated.getNetworkDelay());
    soapOperation.setDefaultMockResponseId(updated.getDefaultMockResponseId());
    soapOperation.setMockOnFailure(updated.getMockOnFailure());
    soapOperation.setIdentifyStrategy(updated.getIdentifyStrategy());

    final SoapOperation updatedSoapOperation = this.operationRepository.update(input.getOperationId(), soapOperation);
    return createServiceResult(UpdateSoapOperationOutput.builder()
        .operation(updatedSoapOperation)
        .build());
  }
}
com.castlemock.core.mock.soap.model.project.domainSoapOperationsetDefaultMockResponseId

Popular methods of SoapOperation

  • <init>
  • setHttpMethod
  • setName
  • getMockResponses
  • setCurrentResponseSequenceIndex
  • setForwardedEndpoint
  • setSoapVersion
  • setStatus
  • getId
  • getName
  • setDefaultBody
  • setId
  • setDefaultBody,
  • setId,
  • setIdentifyStrategy,
  • setInvokeAddress,
  • setMockResponses,
  • setNetworkDelay,
  • setOriginalEndpoint,
  • setPortId,
  • setResponseStrategy,
  • setSimulateNetworkDelay

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now