Tabnine Logo
RESTAssert.assertTrue
Code IndexAdd Tabnine to your IDE (free)

How to use
assertTrue
method
in
de.taimos.restutils.RESTAssert

Best Java code snippets using de.taimos.restutils.RESTAssert.assertTrue (Showing top 5 results out of 315)

origin: de.taimos/restutils

/**
 * returns if condition evaluates to true and throws {@link WebApplicationException}(422) if it evaluates to false
 * 
 * @param condition the condition to assert
 * @throws WebApplicationException with status code 422 (Unprocessable Entity) if condition is <i>false</i>
 */
public static void assertTrue(final boolean condition) {
  RESTAssert.assertTrue(condition, RESTAssert.DEFAULT_STATUS_CODE);
}

origin: de.taimos/restutils

/**
 * assert that object is not null
 * 
 * @param object the object to check
 * @param status the status code to throw
 * @throws WebApplicationException with given status code
 */
public static void assertNotNull(final Object object, final StatusType status) {
  RESTAssert.assertTrue(object != null, status);
}

origin: de.taimos/restutils

/**
 * assert that collection has one element
 * 
 * @param collection the collection to check
 * @param status the status code to throw
 * @throws WebApplicationException with given status code
 */
public static void assertSingleElement(final Collection<?> collection, final StatusType status) {
  RESTAssert.assertNotNull(collection, status);
  RESTAssert.assertTrue(collection.size() == 1, status);
}

origin: de.taimos/restutils

/**
 * assert that objects are equal.<br>
 * This means they are both <i>null</i> or <code>one.equals(two)</code> returns <i>true</i>
 * 
 * @param one the first object
 * @param two the second object
 * @param status the status code to throw
 * @throws WebApplicationException with given status code
 */
@SuppressWarnings("null")
public static void assertEquals(final Object one, final Object two, final StatusType status) {
  if ((one == null) && (two == null)) {
    return;
  }
  RESTAssert.assertNotNull(one, status);
  RESTAssert.assertTrue(one.equals(two), status);
}

origin: de.taimos/restutils

/**
 * assert that string matches the given pattern
 * 
 * @param string the string to check
 * @param status the status code to throw
 * @throws WebApplicationException with given status code
 */
public static void assertPattern(String string, String pattern, final StatusType status) {
  RESTAssert.assertNotNull(string);
  RESTAssert.assertNotNull(pattern);
  RESTAssert.assertTrue(string.matches(pattern), status);
}

de.taimos.restutilsRESTAssertassertTrue

Javadoc

returns if condition evaluates to true and throws WebApplicationException(422) if it evaluates to false

Popular methods of RESTAssert

  • assertNotNull
    assert that object is not null
  • assertNotEmpty
    assert that collection is not empty
  • assertEquals
    assert that objects are equal. This means they are both null or one.equals(two) returns true
  • assertFalse
    returns if condition evaluates to false and throws WebApplicationException if it evaluates to true
  • assertInt
    assert that string matches [+-]?[0-9]
  • assertPattern
    assert that string matches the given pattern
  • assertSingleElement
    assert that collection has one element
  • fail
    fails every time; same as assertTrue(false)

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • runOnUiThread (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Vim 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