JpaInitializer { @Dispose(order = 10) public void stop() { persistService.stop(); } @Inject  JpaInitializer(PersistService persistService); @Start(order = 10) void start(); @Dispose(order = 10) void stop();  }
@Test public void testStop() throws Exception { JpaInitializer jpaInitializer = new JpaInitializer(persistService); jpaInitializer.stop(); verify(persistService).stop(); Method method = JpaInitializer.class.getMethod("stop"); Dispose dispose = method.getAnnotation(Dispose.class); assertEquals(10, dispose.order()); }