Codota Logo
com.castlemock.core.mock.soap.model.project.domain
Code IndexAdd Codota to your IDE (free)

How to use com.castlemock.core.mock.soap.model.project.domain

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: castlemock/castlemock

private static SoapMockResponse createSoapMockResponse(final String defaultBody){
  final SoapMockResponse mockResponse = new SoapMockResponse();
  mockResponse.setBody(defaultBody);
  mockResponse.setStatus(SoapMockResponseStatus.ENABLED);
  mockResponse.setName(AUTO_GENERATED_MOCK_RESPONSE_DEFAULT_NAME);
  mockResponse.setHttpStatusCode(DEFAULT_HTTP_STATUS_CODE);
  return mockResponse;
}
origin: castlemock/castlemock

  public static SoapResource generateSoapResource(){
    final SoapResource soapResource = new SoapResource();
    soapResource.setId("SOAP RESOURCE");
    soapResource.setName("Soap resource name");
    soapResource.setProjectId("Project id");
    soapResource.setType(SoapResourceType.WSDL);
    soapResource.setContent("");
    return soapResource;
  }
}
origin: castlemock/castlemock

/**
 * The method provides the functionality to convert an instance (parent) to an instance of a subclass to the
 * provided parent.
 * @param parent The parent that will be converted into a subtype of the provided parent
 * @return A new instance of the parent, but as a subtype of the parent
 */
@Override
public SoapProject convertType(Project parent) {
  return new SoapProject(parent);
}
origin: castlemock/castlemock

  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;
  }
}
origin: castlemock/castlemock

  public static SoapMockResponse generateSoapMockResponse(){
    final SoapXPathExpression soapXPathExpression1 = new SoapXPathExpression();
    final SoapXPathExpression soapXPathExpression2 = new SoapXPathExpression();
    soapXPathExpression1.setExpression("//Request/Name[text()='Input1']");
    soapXPathExpression2.setExpression("//Request/Name[text()='Input2']");

    final SoapMockResponse soapMockResponse = new SoapMockResponse();
    soapMockResponse.setName("Soap mock response name");
    soapMockResponse.setBody("Soap mock response body");
    soapMockResponse.setId("SOAP MOCK RESPONSE");
    soapMockResponse.setXpathExpression("//Request/Name[text()='Input1']");
    soapMockResponse.setXpathExpressions(Arrays.asList(soapXPathExpression1, soapXPathExpression2));
    soapMockResponse.setStatus(SoapMockResponseStatus.ENABLED);
    return soapMockResponse;
  }
}
origin: castlemock/castlemock

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;
}
origin: castlemock/castlemock

private void verify(final SoapPort soapPort,
          final String name,
          final SoapVersion soapVersion){
  Assert.assertEquals(name + ".Endpoint", soapPort.getName());
  Assert.assertEquals(name + ".Endpoint", soapPort.getUri());
  Assert.assertEquals(1, soapPort.getOperations().size());
  SoapOperation soapOperation = soapPort.getOperations().get(0);
  Assert.assertEquals(name, soapOperation.getName());
  Assert.assertEquals(SoapResponseStrategy.RANDOM, soapOperation.getResponseStrategy());
  Assert.assertEquals(SoapOperationStatus.MOCKED, soapOperation.getStatus());
  Assert.assertEquals(soapVersion, soapOperation.getSoapVersion());
  Assert.assertEquals(HttpMethod.POST, soapOperation.getHttpMethod());
  SoapOperationIdentifier operationIdentifier = soapOperation.getOperationIdentifier();
  Assert.assertNotNull(operationIdentifier);
  Assert.assertEquals("Request", operationIdentifier.getName());
  Assert.assertEquals("http://Services/ServiceExample/ServiceExample/1/Schema",
      operationIdentifier.getNamespace());
}
origin: castlemock/castlemock

public static SoapProject generateSoapProject(){
  final SoapProject project = new SoapProject();
  project.setId("SOAP PROJECT");
  project.setName("Project name");
  project.setDescription("Project description");
  project.setCreated(new Date());
  project.setUpdated(new Date());
  project.setPorts(new ArrayList<SoapPort>());
  return project;
}
origin: castlemock/castlemock

private SoapProject getSoapProject(){
  final SoapProject soapProject = new SoapProject();
  final SoapResource soapResource = new SoapResource();
  soapResource.setId("Resource id");
  soapResource.setName("wsdl");
  soapResource.setType(SoapResourceType.WSDL);
  soapProject.setResources(Arrays.asList(soapResource));
  return soapProject;
}
origin: castlemock/castlemock

public static SoapPort generateSoapPort(){
  final SoapPort soapPort = new SoapPort();
  soapPort.setId("SOAP PORT");
  soapPort.setName("Soap port name");
  soapPort.setUri("UrlPath");
  soapPort.setOperations(new ArrayList<SoapOperation>());
  return soapPort;
}
origin: castlemock/castlemock

private SoapOperation createSoapOperation(String portId, String name) {
  SoapOperation soapOperation = new SoapOperation();
  soapOperation.setName(name);
  soapOperation.setPortId(portId);
  return soapOperation;
}
origin: castlemock/castlemock

  private SoapMockResponse createSoapMockResponse(String name) {
    SoapMockResponse dto = new SoapMockResponse();
    dto.setName(name);
    return dto;
  }
}
origin: castlemock/castlemock

  private SoapProject createSoapProject(String name) {
    SoapProject soapProject = new SoapProject();
    soapProject.setName(name);
    return soapProject;
  }
}
origin: castlemock/castlemock

  /**
   * The method provides the functionality to generate a new mocked response
   * @return A string value of the response
   */
  private static String generateDefaultBody(final SoapOperationIdentifier operationResponseIdentifier){
    final String prefix = "web";
    return "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:" +
        prefix + "=\"" + operationResponseIdentifier.getNamespace() + "\">\n" +
        "   <soapenv:Header/>\n" +
        "   <soapenv:Body>\n" +
        "      <" + prefix + ":" + operationResponseIdentifier.getName() + ">?</" + prefix + ":" +
        operationResponseIdentifier.getName() + ">\n" +
        "   </soapenv:Body>\n" +
        "</soapenv:Envelope>";
  }
}
origin: castlemock/castlemock

protected SoapProject deleteProject(final String projectId){
  final List<SoapPort> ports = this.portRepository.findWithProjectId(projectId);
  final List<SoapResource> resources = this.resourceRepository.findWithProjectId(projectId);
  ports.forEach(port -> this.deletePort(port.getId()));
  resources.forEach(resource -> this.deleteResource(resource.getId()));
  return this.repository.delete(projectId);
}
origin: castlemock/castlemock

private Optional<SoapMockResponse> getDefaultMockResponse(final SoapOperation soapOperation,
                             final List<SoapMockResponse> mockResponses){
  final String defaultResponseId = soapOperation.getDefaultMockResponseId();
  if(defaultResponseId != null && !defaultResponseId.isEmpty()){
    LOGGER.info("Use the default response");
    for (SoapMockResponse tmpMockResponse : mockResponses) {
      if(defaultResponseId.equals(tmpMockResponse.getId())){
        return Optional.of(tmpMockResponse);
      }
    }
    LOGGER.error("Unable to find the default response");
  }
  return Optional.empty();
}
origin: castlemock/castlemock

  /**
   * Count the operation statuses
   * @param soapOperations The list of operations, which status will be counted
   * @return The result of the status count
   */
  private Map<SoapOperationStatus, Integer> getSoapOperationStatusCount(final List<SoapOperation> soapOperations){
    Preconditions.checkNotNull(soapOperations, "The operation list cannot be null");
    final Map<SoapOperationStatus, Integer> statuses = new HashMap<SoapOperationStatus, Integer>();

    for(SoapOperationStatus soapOperationStatus : SoapOperationStatus.values()){
      statuses.put(soapOperationStatus, 0);
    }
    for(SoapOperation soapOperation : soapOperations){
      SoapOperationStatus soapOperationStatus = soapOperation.getStatus();
      statuses.put(soapOperationStatus, statuses.get(soapOperationStatus)+1);
    }
    return statuses;
  }
}
origin: castlemock/castlemock

  @Override
  public int compare(SoapMockResponse o1, SoapMockResponse o2) {
    return ALPHANUM_COMPARATOR.compare(o1.getName(), o2.getName());
  }
}
origin: castlemock/castlemock

/**
 * The method adds a new {@link SoapResource}.
 *
 * @param soapResource The  instance of {@link SoapResource} that will be saved.
 * @param resource     The raw resource
 * @return The saved {@link SoapResource}
 * @see SoapResource
 */
@Override
public SoapResource saveSoapResource(SoapResource soapResource, String resource) {
  soapResource.setContent(resource);
  return save(soapResource);
}
origin: castlemock/castlemock

  public static SoapVersion convert(final String contextType) {
    if(contextType.contains(SOAP12.getContextType())){
      return SOAP12;
    }

    // Return SOAP 1.1 as default
    return SOAP11;
  }
}
com.castlemock.core.mock.soap.model.project.domain

Most used classes

  • SoapProject
    The DTO class for the Project class
  • SoapResource
  • SoapMockResponse
  • SoapOperation
  • SoapOperationIdentifier
  • SoapResourceType,
  • SoapVersion,
  • SoapXPathExpression,
  • SoapOperationIdentifyStrategy,
  • SoapOperationStatus,
  • SoapResponseStrategy,
  • SoapMockResponseStatus
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now