use of io.hops.hopsworks.restutils.RESTCodes in project hopsworks by logicalclocks.
the class TestRESTCodes method getRESTErrorCodes.
@Before
public void getRESTErrorCodes() {
RESTCodes restCodes = new RESTCodes();
Class<?>[] classes = restCodes.getClass().getClasses();
Method method;
for (Class enumClass : classes) {
try {
method = enumClass.getMethod("values");
RESTErrorCode[] obj = (RESTErrorCode[]) method.invoke(null);
values.put(enumClass.getName(), Arrays.asList(obj));
ranges.put(enumClass.getName(), obj[0].getRange());
} catch (ClassCastException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
}
}
}
Aggregations