@Test public void testEmptyMappingPathInSessionContextEmptyMapper() throws ODataException { final OData odata = mock(OData.class); final ODataHttpHandler handler = mock(ODataHttpHandler.class); when(odata.createHandler(any())).thenReturn(handler); final JPAODataCRUDContextAccess context = JPAODataServiceContext.with() .setDataSource(ds) .setPUnit(PUNIT_NAME) .setRequestMappingPath("") .build(); cut = new JPAODataGetHandler(context, odata); cut.process(request, response); verify(handler, times(1)).process(argThat(new HttpRequestMatcher()), any()); }
public void process(final HttpServletRequest request, final HttpServletResponse response) throws ODataException { if (emf.isPresent() && this.requestContext.getEntityManager() == null) { final EntityManager em = emf.get().createEntityManager(); try { this.requestContext.setEntityManager(em); processInternal(request, response); } finally { em.close(); } } else { processInternal(request, response); } }
JPAODataGetHandler { public void process(final HttpServletRequest request, final HttpServletResponse response) throws ODataException { if (emf.isPresent() && this.requestContext.getEntityManager() == null) { final EntityManager em = emf.get().createEntityManager(); try { this.requestContext.setEntityManager(em); processInternal(request, response); } finally { em.close(); } } else { processInternal(request, response); } } }
JPAODataGetHandler { public void process(final HttpServletRequest request, final HttpServletResponse response) throws ODataException { if (emf.isPresent() && this.requestContext.getEntityManager() == null) { final EntityManager em = emf.get().createEntityManager(); try { this.requestContext.setEntityManager(em); processInternal(request, response); } finally { em.close(); } } else { processInternal(request, response); } } @Deprecated  JPAODataGetHandler(final String pUnit); @Deprecated  JPAODataGetHandler(final String pUnit, final DataSource ds);  JPAODataGetHandler(final JPAODataCRUDContextAccess serviceContext);   JPAODataGetHandler(final JPAODataCRUDContextAccess serviceContext, final OData odata); }
JPAODataGetHandler { public void process(final HttpServletRequest request, final HttpServletResponse response) throws ODataException { if (emf.isPresent() && this.requestContext.getEntityManager() == null) { final EntityManager em = emf.get().createEntityManager(); try { this.requestContext.setEntityManager(em); processInternal(request, response); } finally { em.close(); } } else { processInternal(request, response); } } @Deprecated  JPAODataGetHandler(final String pUnit); @Deprecated  JPAODataGetHandler(final String pUnit, final DataSource ds);  JPAODataGetHandler(final JPAODataCRUDContextAccess serviceContext);   JPAODataGetHandler(final JPAODataCRUDContextAccess serviceContext, final OData odata); JPAODataGetContext getJPAODataContext(); JPAODataRequestContext getJPAODataRequestContext(); void process(final HttpServletRequest request, final HttpServletResponse response); @Deprecated void process(final HttpServletRequest request, final HttpServletResponse response, final EntityManager em); @Deprecated void process(final HttpServletRequest request, final HttpServletResponse response,
      final JPAODataClaimProvider claims, final EntityManager em); }
JPAODataGetHandler { public void process(final HttpServletRequest request, final HttpServletResponse response) throws ODataException { if (emf.isPresent() && this.requestContext.getEntityManager() == null) { final EntityManager em = emf.get().createEntityManager(); try { this.requestContext.setEntityManager(em); processInternal(request, response); } finally { em.close(); } } else { processInternal(request, response); } } @Deprecated  JPAODataGetHandler(final String pUnit); @Deprecated  JPAODataGetHandler(final String pUnit, final DataSource ds);  JPAODataGetHandler(final JPAODataCRUDContextAccess serviceContext);   JPAODataGetHandler(final JPAODataCRUDContextAccess serviceContext, final OData odata); JPAODataGetContext getJPAODataContext(); JPAODataRequestContext getJPAODataRequestContext(); void process(final HttpServletRequest request, final HttpServletResponse response); @Deprecated void process(final HttpServletRequest request, final HttpServletResponse response, final EntityManager em); @Deprecated void process(final HttpServletRequest request, final HttpServletResponse response,
      final JPAODataClaimProvider claims, final EntityManager em); final Optional<EntityManagerFactory> emf; }