congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RequestMethod.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
com.github.tomakehurst.wiremock.http.RequestMethod

Best Java code snippets using com.github.tomakehurst.wiremock.http.RequestMethod.getName (Showing top 5 results out of 315)

origin: com.github.tomakehurst/wiremock-jre8

@Override
public String getExpected() {
  return getName();
}
origin: stackoverflow.com

 private void setStub(WireMockServer server, String url, RequestMethod requestMethod, Object body)
   throws JsonProcessingException {

 ObjectMapper mapper = new ObjectMapper();
 String jsonInString = mapper.writeValueAsString(body);

 server.addStubMapping(
    WireMock.request(requestMethod.getName(), WireMock.urlMatching(url))
       .willReturn(WireMock.aResponse().withStatus(200).withBody(jsonInString)
          .withHeader("Content-Type", "text/plain").withHeader("Access-Control-Allow-Origin", "*")
          )
       .build());
}
origin: com.atlassian.oai/swagger-request-validator-wiremock

  /**
   * Builds a {@link Request} for the OpenAPI validator out of the
   * original {@link com.github.tomakehurst.wiremock.http.Request}.
   *
   * @param originalRequest the original {@link com.github.tomakehurst.wiremock.http.Request}
   */
  @Nonnull
  public static Request of(@Nonnull final com.github.tomakehurst.wiremock.http.Request originalRequest) {
    requireNonNull(originalRequest, "An original request is required");

    final URI uri = URI.create(originalRequest.getUrl());
    final Map<String, QueryParameter> queryParameterMap = Urls.splitQuery(uri);

    final SimpleRequest.Builder builder =
        new SimpleRequest.Builder(originalRequest.getMethod().getName(), uri.getPath())
            .withBody(originalRequest.getBodyAsString());
    originalRequest.getHeaders().all().forEach(header -> builder.withHeader(header.key(), header.values()));
    queryParameterMap.forEach((key, value) -> builder.withQueryParam(key, value.values()));
    return builder.build();
  }
}
origin: com.github.tomakehurst/wiremock-jre8

private <B, R> R executeRequest(RequestSpec requestSpec, PathParams pathParams, B requestBody, Class<R> responseType) {
  String url = String.format(ADMIN_URL_PREFIX + requestSpec.path(pathParams), scheme, host, port, urlPathPrefix);
  RequestBuilder requestBuilder = RequestBuilder
      .create(requestSpec.method().getName())
      .setUri(url);
  if (requestBody != null) {
    requestBuilder.setEntity(jsonStringEntity(Json.write(requestBody)));
  }
  String responseBodyString = safelyExecuteRequest(url, requestBuilder.build());
  return responseType == Void.class ?
      null :
      Json.read(responseBodyString, responseType);
}
origin: com.github.tomakehurst/wiremock-jre8

public List<DiffLine<?>> getLines(Map<String, RequestMatcherExtension> customMatcherExtensions) {
  ImmutableList.Builder<DiffLine<?>> builder = ImmutableList.builder();
  DiffLine<RequestMethod> methodSection = new DiffLine<>("HTTP method", requestPattern.getMethod(), request.getMethod(), requestPattern.getMethod().getName());
  builder.add(methodSection);
com.github.tomakehurst.wiremock.httpRequestMethodgetName

Popular methods of RequestMethod

  • fromString
  • <init>
  • equals
  • hashCode
  • isOneOf
  • match
  • toString
  • value

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • putExtra (Intent)
  • setScale (BigDecimal)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 15 Vim 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