@Test public void testExecuteTransaction_WithImage_DeletesAndUpdatesVS() throws Exception { DeleteImageReferenceTask task = this.factory.create(this.imageReference, this.vs); task.execute(); Mockito.verify(this.em).remove(this.imageReference); Mockito.verify(this.em).merge(Mockito.argThat(new ImageReferenceIsEmptyMatcher(this.vs))); Mockito.verify(this.em).merge(this.vs); }
public DeleteImageReferenceTask create(OsImageReference imageReference, VirtualSystem vs) { DeleteImageReferenceTask task = new DeleteImageReferenceTask(); task.imageReference = imageReference; task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
DeleteImageReferenceTask extends TransactionalTask { public DeleteImageReferenceTask create(OsImageReference imageReference, VirtualSystem vs) { DeleteImageReferenceTask task = new DeleteImageReferenceTask(); task.imageReference = imageReference; task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
DeleteImageReferenceTask extends TransactionalTask { public DeleteImageReferenceTask create(OsImageReference imageReference, VirtualSystem vs) { DeleteImageReferenceTask task = new DeleteImageReferenceTask(); task.imageReference = imageReference; task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
DeleteImageReferenceTask extends TransactionalTask { public DeleteImageReferenceTask create(OsImageReference imageReference, VirtualSystem vs) { DeleteImageReferenceTask task = new DeleteImageReferenceTask(); task.imageReference = imageReference; task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  DeleteImageReferenceTask create(OsImageReference imageReference, VirtualSystem vs); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
DeleteImageReferenceTask extends TransactionalTask { public DeleteImageReferenceTask create(OsImageReference imageReference, VirtualSystem vs) { DeleteImageReferenceTask task = new DeleteImageReferenceTask(); task.imageReference = imageReference; task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  DeleteImageReferenceTask create(OsImageReference imageReference, VirtualSystem vs); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }