org.apache.camel.hamcrest
Class Assertions

java.lang.Object
  extended by org.apache.camel.hamcrest.Assertions

public final class Assertions
extends Object

A set of useful assertions you can use when testing

Version:
$Revision: 656656 $

Method Summary
static
<T> T
assertInstanceOf(Object value, Class<T> type)
          Performs the assertion that the given value is an instance of the specified type
static
<T> T
assertInstanceOf(String message, Object value, Class<T> type)
          Performs the assertion that the given value is an instance of the specified type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertInstanceOf

public static <T> T assertInstanceOf(Object value,
                                     Class<T> type)
Performs the assertion that the given value is an instance of the specified type

Parameters:
value - the value to be compared
type - the type to assert
Returns:
the value cast as the type
Throws:
AssertionError - if the instance is not of the correct type

assertInstanceOf

public static <T> T assertInstanceOf(String message,
                                     Object value,
                                     Class<T> type)
Performs the assertion that the given value is an instance of the specified type

Parameters:
message - the description of the value
value - the value to be compared
type - the type to assert
Returns:
the value cast as the type
Throws:
AssertionError - if the instance is not of the correct type


Apache CAMEL