OresHelper { public static OLATResourceable lookupType(Class aClass) { return lookupType(aClass, null); }  static OLATResourceable createOLATResourceableInstance(final String type, final Long key); static OLATResourceable createOLATResourceableType(final String type, final String subtype); static OLATResourceable createOLATResourceableType(final String type); static OLATResourceable createOLATResourceableType(Class clazz); static OLATResourceable createOLATResourceableInstance(Class aClass, final Long key); static String createStringRepresenting(OLATResourceable ores, String subKey); static String createStringRepresenting(OLATResourceable ores); static OLATResourceable lookupType(Class aClass); static String calculateTypeName(Class aClass); static String calculateTypeName(Class aClass, String subType); static boolean isOfType(OLATResourceable ores, Class aClass); static OLATResourceable lookupType(Class aClass, String subType); static boolean equals(OLATResourceable a, OLATResourceable b); static OLATResourceable createOLATResourceableTypeWithoutCheck(String type); static OLATResourceable createOLATResourceableInstanceWithoutCheck(final String type, final Long key); static final int ORES_TYPE_LENGTH; }
@Test public void lookupType() { OLATResourceable resourceable = OresHelper.lookupType(classInstance); assertNotNull(resourceable); assertNotNull(resourceable.getResourceableTypeName()); assertEquals(resourceable.getResourceableTypeName(), CLASS_NAME_NO_PACKAGE); assertNull(resourceable.getResourceableId()); }
@Test public void lookupType_WithSubtype() { OLATResourceable resourceable = OresHelper.lookupType(classInstance, SUBTYPE); assertNotNull(resourceable); assertNotNull(resourceable.getResourceableTypeName()); assertEquals(resourceable.getResourceableTypeName(), CLASS_NAME_NO_PACKAGE_WITH_SUBTYPE); assertNull(resourceable.getResourceableId()); }