Java Assert assertHasInterface(Class interfaceClass, Class objectClass)

Here you can find the source of assertHasInterface(Class interfaceClass, Class objectClass)

Description

assert Has Interface

License

Open Source License

Declaration

public static void assertHasInterface(Class<?> interfaceClass, Class<?> objectClass) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static void assertHasInterface(Class<?> interfaceClass, Class<?> objectClass) {
        Class<?>[] interfaces = objectClass.getInterfaces();
        for (Class<?> singleInterface : interfaces) {
            if (singleInterface.equals(interfaceClass)) {
                return;
            }/*from   w ww .  j  ava  2  s .  c o  m*/
        }
        throw new AssertionError("Class " + objectClass.getName() + " did not implement interface: " + ""
                + interfaceClass.getName());
    }
}

Related

  1. assertFalse(String string, boolean b)
  2. assertFieldPositive(int fieldValue, String fieldName)
  3. assertGreater(long first, long second)
  4. assertGreaterOrEqualsThan(final long value, final long limit, final String name)
  5. assertGreaterThanOrEquals(String name, double comparedTo, double number)
  6. assertHasLength(String... params)
  7. assertHasText(String str)
  8. assertHexOrDecLongValue(String value)
  9. assertInBounds(final String param, final int value, final int min, final int max)