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

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

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

origin: de.taimos/restutils

/**
 * assert that string is not null nor empty
 * 
 * @param string the string to check
 * @throws WebApplicationException with status code 422 (Unprocessable Entity)
 */
public static void assertNotEmpty(final String string) {
  RESTAssert.assertNotEmpty(string, RESTAssert.DEFAULT_STATUS_CODE);
}

origin: de.taimos/restutils

/**
 * assert that collection is not empty
 * 
 * @param collection the collection to check
 * @throws WebApplicationException with status code 422 (Unprocessable Entity)
 */
public static void assertNotEmpty(final Collection<?> collection) {
  RESTAssert.assertNotEmpty(collection, RESTAssert.DEFAULT_STATUS_CODE);
}

origin: de.taimos/restutils

/**
 * assert that string matches [+-]?[0-9]*
 * 
 * @param string the string to check
 * @param status the status code to throw
 * @throws WebApplicationException with given status code
 */
public static void assertInt(final String string, final StatusType status) {
  RESTAssert.assertNotEmpty(string);
  RESTAssert.assertPattern(string, "[+-]?[0-9]*", status);
}

origin: de.taimos/dvalin-jaxrs

@POST
public Response createTicket(T ticket) {
  RESTAssert.assertNotEmpty(ticket.getRequesterMail());
  RESTAssert.assertNotEmpty(ticket.getRequesterMail());
  RESTAssert.assertNotEmpty(ticket.getSubject());
  RESTAssert.assertNotEmpty(ticket.getBody());
  Ticket tick = new Ticket();
  tick.setRequesterName(ticket.getRequesterName());
  tick.setRequesterEMail(ticket.getRequesterMail());
  tick.setSubject(ticket.getSubject());
  tick.setComment(ticket.getBody());
  this.customConversion(tick, ticket);
  this.createTicket(tick);
  return Response.accepted().build();
}
de.taimos.restutilsRESTAssertassertNotEmpty

Javadoc

assert that string is not null nor empty

Popular methods of RESTAssert

  • assertNotNull
    assert that object is not null
  • 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
  • assertTrue
    returns if condition evaluates to true and throws WebApplicationException if it evaluates to false
  • fail
    fails every time; same as assertTrue(false)

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 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