Tabnine Logo
RestEnricher.getBaseURL
Code IndexAdd Tabnine to your IDE (free)

How to use
getBaseURL
method
in
org.jboss.arquillian.extension.rest.client.RestEnricher

Best Java code snippets using org.jboss.arquillian.extension.rest.client.RestEnricher.getBaseURL (Showing top 7 results out of 315)

origin: arquillian/arquillian-extension-rest

  @Override
  protected Object enrichByType(Class<?> clazz, Method method, ArquillianResteasyResource annotation, Consumes consumes,
    Produces produces) {
    Object result = null;
    if (ClientBuilder.class.isAssignableFrom(clazz)) {
      result = ClientBuilder.newBuilder();
    } else if (Client.class.isAssignableFrom(clazz)) {
      result = ClientBuilder.newClient();
    } else if (WebTarget.class.isAssignableFrom(clazz)) {
      WebTarget webTarget = ClientBuilder.newClient().target(getBaseURL() + annotation.value());
      final Map<String, String> headers = getHeaders(clazz, method);
      if (!headers.isEmpty()) {
        webTarget.register(new HeaderFilter(headers));
      }
      result = webTarget;
    }
    return result;
  }
}
origin: arquillian/arquillian-extension-rest

@Override
protected Object enrichByType(Class<?> clazz, Method method, ArquillianResteasyResource annotation, Consumes consumes,
  Produces produces) {
  Object value;
  Client client = JerseyClientBuilder.newClient();
  WebTarget webTarget = client.target(getBaseURL() + annotation.value());
  final Map<String, String> headers = getHeaders(clazz, method);
  if (!headers.isEmpty()) {
    webTarget.register(new HeaderFilter(headers));
  }
  JerseyWebTarget jerseyWebTarget = (JerseyWebTarget) webTarget;
  if (WebTarget.class.isAssignableFrom(clazz)) {
    value = jerseyWebTarget;
  } else {
    final Class<?> parameterType;
    try {
      final Annotation[] methodDeclaredAnnotations = method.getDeclaredAnnotations();
      //                                This is test method so if it only contains @Test annotation then we don't need to hassel with substitutions
      parameterType = methodDeclaredAnnotations.length <= 1 ? clazz
        : ClassModifier.getModifiedClass(clazz, methodDeclaredAnnotations);
    } catch (Exception e) {
      throw new RuntimeException("Cannot substitute annotations for method " + method.getName(), e);
    }
    value = WebResourceFactory.newResource(parameterType, jerseyWebTarget);
  }
  return value;
}
origin: org.jboss.arquillian.extension/arquillian-rest-client-impl-jersey

  @Override
  protected Object enrichByType(Class<?> clazz, Method method, ArquillianResteasyResource annotation, Consumes consumes, Produces produces)
  {
    Object value;
    Client client = JerseyClientBuilder.newClient();
    WebTarget webTarget = client.target(getBaseURL() + annotation.value());
    final Map<String, String> headers = getHeaders(clazz, method);
    if (!headers.isEmpty()) {
      webTarget.register(new HeaderFilter(headers));
    }
    JerseyWebTarget jerseyWebTarget = (JerseyWebTarget) webTarget;
    if (WebTarget.class.isAssignableFrom(clazz)) {
      value = jerseyWebTarget;
    } else {
      final Class<?> parameterType;
      try {
        final Annotation[] methodDeclaredAnnotations = method.getDeclaredAnnotations();
//                                This is test method so if it only contains @Test annotation then we don't need to hassel with substitutions
        parameterType = methodDeclaredAnnotations.length <= 1 ? clazz : ClassModifier.getModifiedClass(clazz, methodDeclaredAnnotations);
      } catch (Exception e) {
        throw new RuntimeException("Cannot substitute annotations for method " + method.getName(), e);
      }
      value = WebResourceFactory.newResource(parameterType, jerseyWebTarget);
    }
    return value;
  }

origin: arquillian/arquillian-extension-rest

Object value;
Client client = ResteasyClientBuilder.newClient();
WebTarget webTarget = client.target(getBaseURL() + annotation.value());
final Map<String, String> headers = getHeaders(clazz, method);
if (!headers.isEmpty()) {
origin: org.jboss.arquillian.extension/arquillian-rest-client-impl-3x

WebTarget webTarget = client.target(getBaseURL() + annotation.value());
final Map<String, String> headers = getHeaders(clazz, method);
if (!headers.isEmpty()) {
origin: org.jboss.arquillian.extension/arquillian-rest-client-impl-2x

final String resourcePath = annotation.value();
if (ClientRequest.class.isAssignableFrom(clazz)) {
  final ClientRequest clientRequest = new ClientRequestFactory(getBaseURL()).createRelativeRequest(resourcePath);
  final Map<String, String> headers = getHeaders(clazz, method);
  if (!headers.isEmpty()) {
    throw new RuntimeException("Cannot substitute annotations for method " + method.getName(), e);
  final ProxyBuilder<?> proxyBuilder = ProxyBuilder.build(parameterType, getBaseURL() + resourcePath);
  final Map<String, String> headers = getHeaders(clazz, method);
  if (!headers.isEmpty()) {
origin: arquillian/arquillian-extension-rest

if (ClientRequest.class.isAssignableFrom(clazz)) {
  final ClientRequest clientRequest =
    new ClientRequestFactory(getBaseURL()).createRelativeRequest(resourcePath);
  final Map<String, String> headers = getHeaders(clazz, method);
  if (!headers.isEmpty()) {
    throw new RuntimeException("Cannot substitute annotations for method " + method.getName(), e);
  final ProxyBuilder<?> proxyBuilder = ProxyBuilder.build(parameterType, getBaseURL() + resourcePath);
  final Map<String, String> headers = getHeaders(clazz, method);
  if (!headers.isEmpty()) {
org.jboss.arquillian.extension.rest.clientRestEnrichergetBaseURL

Popular methods of RestEnricher

  • getHeaders

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onCreateOptionsMenu (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JTable (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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