@Test public void testExecuteTransaction_WithImageWithoutApplianceVersion_ExpectsUpdate() throws Exception { OsImageReference imageReference = new OsImageReference(this.vs, "region", "refId"); this.vs.addOsImageReference(imageReference); imageReference.setApplianceVersion(null); UpdateVsWithImageVersionTask task = this.task.create(this.vs); task.execute(); Mockito.verify(this.em).merge(this.vs); Mockito.verify(this.em).merge(Mockito.argThat(new ImageReferenceHasVersionMatcher(this.vs))); }
public UpdateVsWithImageVersionTask create(VirtualSystem vs) { UpdateVsWithImageVersionTask task = new UpdateVsWithImageVersionTask(); task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
UpdateVsWithImageVersionTask extends TransactionalTask { public UpdateVsWithImageVersionTask create(VirtualSystem vs) { UpdateVsWithImageVersionTask task = new UpdateVsWithImageVersionTask(); task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
UpdateVsWithImageVersionTask extends TransactionalTask { public UpdateVsWithImageVersionTask create(VirtualSystem vs) { UpdateVsWithImageVersionTask task = new UpdateVsWithImageVersionTask(); task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
UpdateVsWithImageVersionTask extends TransactionalTask { public UpdateVsWithImageVersionTask create(VirtualSystem vs) { UpdateVsWithImageVersionTask task = new UpdateVsWithImageVersionTask(); task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  UpdateVsWithImageVersionTask create(VirtualSystem vs); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
UpdateVsWithImageVersionTask extends TransactionalTask { public UpdateVsWithImageVersionTask create(VirtualSystem vs) { UpdateVsWithImageVersionTask task = new UpdateVsWithImageVersionTask(); task.vs = vs; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  UpdateVsWithImageVersionTask create(VirtualSystem vs); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }