@Test public void bapiInterceptorFromConfigurationIsCalledWhenExecutingFunction() { final Object bapiObject = new Object(); session.execute(bapiObject); verify(bapiInterceptor).beforeExecution(bapiObject); verify(bapiInterceptor).afterExecution(bapiObject); }
public void execute(final Object bapiObject) { assertNotClosed(); Class<?> bapiClass = bapiObject.getClass(); Map<String, BapiMapping> bapiMappings = sessionManager.getBapiMappings(); if (bapiMappings.containsKey(bapiClass.getName())) { bapiInterceptors.announce().beforeExecution(bapiObject); execute(bapiObject, bapiMappings.get(bapiClass.getName())); bapiInterceptors.announce().afterExecution(bapiObject); } else { throw new HibersapException(bapiClass.getName() + " is not mapped as a Bapi class"); } }
SessionImpl implements Session, SessionImplementor { public void execute(final Object bapiObject) { assertNotClosed(); Class<?> bapiClass = bapiObject.getClass(); Map<String, BapiMapping> bapiMappings = sessionManager.getBapiMappings(); if (bapiMappings.containsKey(bapiClass.getName())) { bapiInterceptors.announce().beforeExecution(bapiObject); execute(bapiObject, bapiMappings.get(bapiClass.getName())); bapiInterceptors.announce().afterExecution(bapiObject); } else { throw new HibersapException(bapiClass.getName() + " is not mapped as a Bapi class"); } } }
SessionImpl implements Session, SessionImplementor { public void execute(final Object bapiObject) { assertNotClosed(); Class<?> bapiClass = bapiObject.getClass(); Map<String, BapiMapping> bapiMappings = sessionManager.getBapiMappings(); if (bapiMappings.containsKey(bapiClass.getName())) { bapiInterceptors.announce().beforeExecution(bapiObject); execute(bapiObject, bapiMappings.get(bapiClass.getName())); bapiInterceptors.announce().afterExecution(bapiObject); } else { throw new HibersapException(bapiClass.getName() + " is not mapped as a Bapi class"); } } SessionImpl(final SessionManagerImplementor sessionManager);  SessionImpl(final SessionManagerImplementor sessionManager, final Credentials credentials); }
SessionImpl implements Session, SessionImplementor { public void execute(final Object bapiObject) { assertNotClosed(); Class<?> bapiClass = bapiObject.getClass(); Map<String, BapiMapping> bapiMappings = sessionManager.getBapiMappings(); if (bapiMappings.containsKey(bapiClass.getName())) { bapiInterceptors.announce().beforeExecution(bapiObject); execute(bapiObject, bapiMappings.get(bapiClass.getName())); bapiInterceptors.announce().afterExecution(bapiObject); } else { throw new HibersapException(bapiClass.getName() + " is not mapped as a Bapi class"); } } SessionImpl(final SessionManagerImplementor sessionManager);  SessionImpl(final SessionManagerImplementor sessionManager, final Credentials credentials); Transaction beginTransaction(); void close(); void execute(final Object bapiObject); void execute(final Object bapiObject, final BapiMapping bapiMapping); SessionManagerImplementor getSessionManager(); Transaction getTransaction(); boolean isClosed(); void addExecutionInterceptor(final ExecutionInterceptor interceptor); void addBapiInterceptor(final BapiInterceptor interceptor); }
SessionImpl implements Session, SessionImplementor { public void execute(final Object bapiObject) { assertNotClosed(); Class<?> bapiClass = bapiObject.getClass(); Map<String, BapiMapping> bapiMappings = sessionManager.getBapiMappings(); if (bapiMappings.containsKey(bapiClass.getName())) { bapiInterceptors.announce().beforeExecution(bapiObject); execute(bapiObject, bapiMappings.get(bapiClass.getName())); bapiInterceptors.announce().afterExecution(bapiObject); } else { throw new HibersapException(bapiClass.getName() + " is not mapped as a Bapi class"); } } SessionImpl(final SessionManagerImplementor sessionManager);  SessionImpl(final SessionManagerImplementor sessionManager, final Credentials credentials); Transaction beginTransaction(); void close(); void execute(final Object bapiObject); void execute(final Object bapiObject, final BapiMapping bapiMapping); SessionManagerImplementor getSessionManager(); Transaction getTransaction(); boolean isClosed(); void addExecutionInterceptor(final ExecutionInterceptor interceptor); void addBapiInterceptor(final BapiInterceptor interceptor);  }