Codota Logo
MultiMatcher.matchingMethods
Code IndexAdd Codota to your IDE (free)

How to use
matchingMethods
method
in
com.nike.riposte.util.MultiMatcher

Best Java code snippets using com.nike.riposte.util.MultiMatcher.matchingMethods (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: Nike-Inc/riposte

/**
 * {@inheritDoc}
 */
@Override
public boolean matchesMethod(RequestInfo<?> request) {
  if (matchAllMethods)
    return true;
  //noinspection SimplifiableIfStatement
  if (request == null || request.getMethod() == null)
    return false;
  return matchingMethods().contains(request.getMethod());
}
origin: Nike-Inc/riposte

@Test
public void static_factory_with_path_arg_only_sets_values_as_expected() {
  // given
  String path = "/" + UUID.randomUUID().toString();
  Collection<String> paths = new ArrayList<String>() {{ add(path); }};
  // when
  MultiMatcher matcher = MultiMatcher.match(paths);
  // then
  assertThat(matcher.matchingPathTemplates(), is(paths));
  assertThat(matcher.matchingMethods(), notNullValue());
  assertThat(matcher.matchingMethods().isEmpty(), is(true));
  assertThat(matcher.isMatchAllMethods(), is(true));
}
origin: Nike-Inc/riposte

@Test
public void static_factory_with_path_and_methods_varargs_sets_values_as_expected() {
  // given
  String path = "/" + UUID.randomUUID().toString();
  Collection<String> paths = new ArrayList<String>() {{ add(path); }};
  HttpMethod[] methodVarargs = new HttpMethod[]{HttpMethod.GET, HttpMethod.PUT};
  // when
  MultiMatcher matcher = MultiMatcher.match(paths, methodVarargs);
  // then
  assertThat(matcher.matchingPathTemplates(), is(paths));
  assertThat(matcher.matchingMethods(), notNullValue());
  assertThat(matcher.matchingMethods().size(), is(methodVarargs.length));
  for (HttpMethod expectedMethod : methodVarargs) {
    assertThat(matcher.matchingMethods().contains(expectedMethod), is(true));
  }
  assertThat(matcher.isMatchAllMethods(), is(false));
}
origin: Nike-Inc/riposte

@Test
public void static_factory_with_path_and_methods_collection_sets_values_as_expected() {
  // given
  String path = "/" + UUID.randomUUID().toString();
  Collection<String> paths = new ArrayList<String>() {{ add(path); }};
  Collection<HttpMethod> methodCollection = Arrays.asList(HttpMethod.GET, HttpMethod.PUT);
  // when
  MultiMatcher matcher = MultiMatcher.match(paths, methodCollection);
  // then
  assertThat(matcher.matchingPathTemplates(), is(paths));
  assertThat(matcher.matchingMethods(), is(methodCollection));
  assertThat(matcher.isMatchAllMethods(), is(false));
}
origin: Nike-Inc/riposte

@SuppressWarnings("ConstantConditions")
@Test
public void constructor_sets_fields_as_expected() {
  // given
  String path1 = "/" + UUID.randomUUID().toString();
  String path2 = "/" + UUID.randomUUID().toString();
  Collection<String> paths = new ArrayList<String>() {{ add(path1); add(path2); }};
  Collection<HttpMethod> methods = Arrays.asList(HttpMethod.CONNECT, HttpMethod.PATCH);
  boolean matchAllMethods = false;
  // when
  MultiMatcher matcher = new MultiMatcher(paths, methods, matchAllMethods);
  // then
  assertThat(matcher.matchingPathTemplates(), is(paths));
  assertThat(matcher.matchingMethods(), is(methods));
  assertThat(matcher.isMatchAllMethods(), is(matchAllMethods));
}
com.nike.riposte.utilMultiMatchermatchingMethods

Popular methods of MultiMatcher

  • match
  • <init>
  • isMatchAllMethods
  • matchesMethod
  • matchesPath
  • matchingPathTemplates

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
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