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

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • setContentView (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Path (java.nio.file)
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JFrame (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook Extensions
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