Tabnine Logo
AbstractStringAssert.doesNotEndWith
Code IndexAdd Tabnine to your IDE (free)

How to use
doesNotEndWith
method
in
org.assertj.core.api.AbstractStringAssert

Best Java code snippets using org.assertj.core.api.AbstractStringAssert.doesNotEndWith (Showing top 4 results out of 315)

origin: openzipkin/brave

private void routeBasedRequestNameIncludesPathPrefix(String prefix) throws Exception {
 Response request1 = get(prefix + "/1?foo");
 Response request2 = get(prefix + "/2?bar");
 // get() doesn't check the response, check to make sure the server didn't 500
 assertThat(request1.isSuccessful()).isTrue();
 assertThat(request2.isSuccessful()).isTrue();
 // Reading the route parameter from the response ensures the test endpoint is correct
 assertThat(request1.body().string())
   .isEqualTo("1");
 assertThat(request2.body().string())
   .isEqualTo("2");
 Span span1 = takeSpan(), span2 = takeSpan();
 // verify that the path and url reflect the initial request (not a route expression)
 assertThat(span1.tags())
   .containsEntry("http.method", "GET")
   .containsEntry("http.path", prefix + "/1")
   .containsEntry("http.url", url(prefix + "/1?foo"));
 assertThat(span2.tags())
   .containsEntry("http.method", "GET")
   .containsEntry("http.path", prefix + "/2")
   .containsEntry("http.url", url(prefix + "/2?bar"));
 // We don't know the exact format of the http route as it is framework specific
 // However, we know that it should match both requests and include the common part of the path
 Set<String> routeBasedNames = new LinkedHashSet<>(Arrays.asList(span1.name(), span2.name()));
 assertThat(routeBasedNames).hasSize(1);
 assertThat(routeBasedNames.iterator().next())
   .startsWith("get " + prefix)
   .doesNotEndWith("/") // no trailing slashes
   .doesNotContain("//"); // no duplicate slashes
}
origin: apache/geode

 @Test
 public void consoleModeShouldRedirectOnlyJDKLoggers() {
  gfsh = new Gfsh(true, null, new GfshConfig());
  LogManager logManager = LogManager.getLogManager();
  Enumeration<String> loggerNames = logManager.getLoggerNames();
  // when initialized in console mode, all log messages will show up in console
  // initially. so that we see messages when "start locator", "start server" command
  // are executed. Only after connection, JDK's logging is turned off
  while (loggerNames.hasMoreElements()) {
   String loggerName = loggerNames.nextElement();
   Logger logger = logManager.getLogger(loggerName);
   // make sure jdk's logging goes to the gfsh log file
   if (loggerName.startsWith("java")) {
    assertThat(logger.getParent().getName()).endsWith("LogWrapper");
   }
   // make sure Gfsh's logging goes to the gfsh log file
   else if (loggerName.endsWith(".Gfsh")) {
    assertThat(logger.getParent().getName()).doesNotEndWith("LogWrapper");
   }
   // make sure SimpleParser's logging will still show up in the console
   else if (loggerName.endsWith(".SimpleParser")) {
    assertThat(logger.getParent().getName()).doesNotEndWith("LogWrapper");
   }
  }
 }
}
origin: apache/geode

 @Test
 public void headlessModeShouldRedirectBothJDKAndGFSHLoggers() {
  gfsh = new Gfsh(false, null, new GfshConfig());
  LogManager logManager = LogManager.getLogManager();
  Enumeration<String> loggerNames = logManager.getLoggerNames();
  while (loggerNames.hasMoreElements()) {
   String loggerName = loggerNames.nextElement();
   Logger logger = logManager.getLogger(loggerName);
   // make sure jdk's logging goes to the gfsh log file
   if (loggerName.startsWith("java")) {
    assertThat(logger.getParent().getName()).endsWith("LogWrapper");
   }
   // make sure Gfsh's logging goes to the gfsh log file
   else if (loggerName.endsWith(".Gfsh")) {
    assertThat(logger.getParent().getName()).endsWith("LogWrapper");
   }
   // make sure SimpleParser's logging will still show up in the console
   else if (loggerName.endsWith(".SimpleParser")) {
    assertThat(logger.getParent().getName()).doesNotEndWith("LogWrapper");
   }
  }
 }
}
origin: io.zipkin.brave/brave-instrumentation-http-tests

private void routeBasedRequestNameIncludesPathPrefix(String prefix) throws Exception {
 Response request1 = get(prefix + "/1?foo");
 Response request2 = get(prefix + "/2?bar");
 // get() doesn't check the response, check to make sure the server didn't 500
 assertThat(request1.isSuccessful()).isTrue();
 assertThat(request2.isSuccessful()).isTrue();
 // Reading the route parameter from the response ensures the test endpoint is correct
 assertThat(request1.body().string())
   .isEqualTo("1");
 assertThat(request2.body().string())
   .isEqualTo("2");
 Span span1 = takeSpan(), span2 = takeSpan();
 // verify that the path and url reflect the initial request (not a route expression)
 assertThat(span1.tags())
   .containsEntry("http.method", "GET")
   .containsEntry("http.path", prefix + "/1")
   .containsEntry("http.url", url(prefix + "/1?foo"));
 assertThat(span2.tags())
   .containsEntry("http.method", "GET")
   .containsEntry("http.path", prefix + "/2")
   .containsEntry("http.url", url(prefix + "/2?bar"));
 // We don't know the exact format of the http route as it is framework specific
 // However, we know that it should match both requests and include the common part of the path
 Set<String> routeBasedNames = new LinkedHashSet<>(Arrays.asList(span1.name(), span2.name()));
 assertThat(routeBasedNames).hasSize(1);
 assertThat(routeBasedNames.iterator().next())
   .startsWith("get " + prefix)
   .doesNotEndWith("/") // no trailing slashes
   .doesNotContain("//"); // no duplicate slashes
}
org.assertj.core.apiAbstractStringAssertdoesNotEndWith

Popular methods of AbstractStringAssert

  • isEqualTo
  • contains
  • isNull
  • isNotNull
  • startsWith
  • isEmpty
  • isNotEqualTo
  • isNotEmpty
  • doesNotContain
  • as
  • matches
  • endsWith
  • matches,
  • endsWith,
  • isEqualToIgnoringCase,
  • containsPattern,
  • isSameAs,
  • isEqualToIgnoringWhitespace,
  • isIn,
  • isNotBlank,
  • describedAs,
  • isEqualToNormalizingNewlines

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JCheckBox (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • 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