@Test public void getSessionManagerJndiNameReturnsTheCorrectValue() throws Exception { Field session1Field = TestBean.class.getDeclaredField("session1"); String jndiName = ReflectionUtil.getSessionManagerJndiName(session1Field); assertThat(jndiName).isEqualTo("jndiName1"); }
public static String getSessionManagerJndiName(final Field sessionField) { HibersapSession annotation = sessionField.getAnnotation(HibersapSession.class); if (annotation == null) { throw new InternalHiberSapException(format("The field %s.%s is not annotated with @%s", sessionField.getDeclaringClass().getName(), sessionField.getName(), HibersapSession.class.getSimpleName())); } return annotation.value(); }
ReflectionUtil { public static String getSessionManagerJndiName(final Field sessionField) { HibersapSession annotation = sessionField.getAnnotation(HibersapSession.class); if (annotation == null) { throw new InternalHiberSapException(format("The field %s.%s is not annotated with @%s", sessionField.getDeclaringClass().getName(), sessionField.getName(), HibersapSession.class.getSimpleName())); } return annotation.value(); } }
ReflectionUtil { public static String getSessionManagerJndiName(final Field sessionField) { HibersapSession annotation = sessionField.getAnnotation(HibersapSession.class); if (annotation == null) { throw new InternalHiberSapException(format("The field %s.%s is not annotated with @%s", sessionField.getDeclaringClass().getName(), sessionField.getName(), HibersapSession.class.getSimpleName())); } return annotation.value(); } private  ReflectionUtil(); }
ReflectionUtil { public static String getSessionManagerJndiName(final Field sessionField) { HibersapSession annotation = sessionField.getAnnotation(HibersapSession.class); if (annotation == null) { throw new InternalHiberSapException(format("The field %s.%s is not annotated with @%s", sessionField.getDeclaringClass().getName(), sessionField.getName(), HibersapSession.class.getSimpleName())); } return annotation.value(); } private  ReflectionUtil(); static Set<Field> getHibersapSessionFields(final Object target); static String getSessionManagerJndiName(final Field sessionField); static void injectSessionIntoTarget(final Object target, final Field field, final Session session); }
ReflectionUtil { public static String getSessionManagerJndiName(final Field sessionField) { HibersapSession annotation = sessionField.getAnnotation(HibersapSession.class); if (annotation == null) { throw new InternalHiberSapException(format("The field %s.%s is not annotated with @%s", sessionField.getDeclaringClass().getName(), sessionField.getName(), HibersapSession.class.getSimpleName())); } return annotation.value(); } private  ReflectionUtil(); static Set<Field> getHibersapSessionFields(final Object target); static String getSessionManagerJndiName(final Field sessionField); static void injectSessionIntoTarget(final Object target, final Field field, final Session session);  }