@Test public void shouldUpdateObject() throws Exception { ArrayList<AbstractWitsmlObject> witsmlObjects; witsmlObjects = new ArrayList<>(); ObjWellbore wellboreA = new ObjWellbore(); wellboreA.setName("wellbore-A"); wellboreA.setUid("wellbore-A"); witsmlObjects.add(wellboreA); QueryContext qc = new QueryContext( "1.3.1.1", "wellbore", null, "", witsmlObjects, "goodUsername", "goodPassword", "shouldUpdateObject" ); this.valve.updateObject(qc); verify(this.mockDelegator).updateObject(wellboreA, qc.USERNAME, qc.PASSWORD, qc.EXCHANGE_ID, this.mockClient); verifyNoMoreInteractions(this.mockDelegator); }
@Override @Async("asyncCustomTaskExecutor") public CompletableFuture<Boolean> updateObject(QueryContext qc) throws ValveException { boolean result = false; try { for (AbstractWitsmlObject witsmlObject : qc.WITSML_OBJECTS) { this.DELEGATOR.updateObject(witsmlObject, qc.USERNAME, qc.PASSWORD, qc.EXCHANGE_ID, this.CLIENT); } result = true; } catch (Exception e) { LOG.warning(ValveLogging.getLogMsg(qc.EXCHANGE_ID,"Exception in DotValve updateObject: " + e.getMessage())); throw new ValveException(e.getMessage()); } return CompletableFuture.completedFuture(result); }
DotValve implements IValve { @Override @Async("asyncCustomTaskExecutor") public CompletableFuture<Boolean> updateObject(QueryContext qc) throws ValveException { boolean result = false; try { for (AbstractWitsmlObject witsmlObject : qc.WITSML_OBJECTS) { this.DELEGATOR.updateObject(witsmlObject, qc.USERNAME, qc.PASSWORD, qc.EXCHANGE_ID, this.CLIENT); } result = true; } catch (Exception e) { LOG.warning(ValveLogging.getLogMsg(qc.EXCHANGE_ID,"Exception in DotValve updateObject: " + e.getMessage())); throw new ValveException(e.getMessage()); } return CompletableFuture.completedFuture(result); } }
DotValve implements IValve { @Override @Async("asyncCustomTaskExecutor") public CompletableFuture<Boolean> updateObject(QueryContext qc) throws ValveException { boolean result = false; try { for (AbstractWitsmlObject witsmlObject : qc.WITSML_OBJECTS) { this.DELEGATOR.updateObject(witsmlObject, qc.USERNAME, qc.PASSWORD, qc.EXCHANGE_ID, this.CLIENT); } result = true; } catch (Exception e) { LOG.warning(ValveLogging.getLogMsg(qc.EXCHANGE_ID,"Exception in DotValve updateObject: " + e.getMessage())); throw new ValveException(e.getMessage()); } return CompletableFuture.completedFuture(result); } DotValve(Map<String, String> config);  DotValve(DotClient client, DotDelegator delegator); }
DotValve implements IValve { @Override @Async("asyncCustomTaskExecutor") public CompletableFuture<Boolean> updateObject(QueryContext qc) throws ValveException { boolean result = false; try { for (AbstractWitsmlObject witsmlObject : qc.WITSML_OBJECTS) { this.DELEGATOR.updateObject(witsmlObject, qc.USERNAME, qc.PASSWORD, qc.EXCHANGE_ID, this.CLIENT); } result = true; } catch (Exception e) { LOG.warning(ValveLogging.getLogMsg(qc.EXCHANGE_ID,"Exception in DotValve updateObject: " + e.getMessage())); throw new ValveException(e.getMessage()); } return CompletableFuture.completedFuture(result); } DotValve(Map<String, String> config);  DotValve(DotClient client, DotDelegator delegator); @Override String getName(); @Override String getDescription(); @Override String getObjectSelectionCapability(String WMLtypeIn); @Override @Async("asyncCustomTaskExecutor") CompletableFuture<String> getObject(QueryContext qc); static boolean trajHasSearchQueryArgs( QueryContext qc ); @Override @Async("asyncCustomTaskExecutor") CompletableFuture<String> createObject(QueryContext qc); @Override @Async("asyncCustomTaskExecutor") CompletableFuture<Boolean> deleteObject(QueryContext qc); @Override @Async("asyncCustomTaskExecutor") CompletableFuture<Boolean> updateObject(QueryContext qc); @Override void authenticate(String username, String password); Map<String, AbstractWitsmlObject[]> getCap(); }
DotValve implements IValve { @Override @Async("asyncCustomTaskExecutor") public CompletableFuture<Boolean> updateObject(QueryContext qc) throws ValveException { boolean result = false; try { for (AbstractWitsmlObject witsmlObject : qc.WITSML_OBJECTS) { this.DELEGATOR.updateObject(witsmlObject, qc.USERNAME, qc.PASSWORD, qc.EXCHANGE_ID, this.CLIENT); } result = true; } catch (Exception e) { LOG.warning(ValveLogging.getLogMsg(qc.EXCHANGE_ID,"Exception in DotValve updateObject: " + e.getMessage())); throw new ValveException(e.getMessage()); } return CompletableFuture.completedFuture(result); } DotValve(Map<String, String> config);  DotValve(DotClient client, DotDelegator delegator); @Override String getName(); @Override String getDescription(); @Override String getObjectSelectionCapability(String WMLtypeIn); @Override @Async("asyncCustomTaskExecutor") CompletableFuture<String> getObject(QueryContext qc); static boolean trajHasSearchQueryArgs( QueryContext qc ); @Override @Async("asyncCustomTaskExecutor") CompletableFuture<String> createObject(QueryContext qc); @Override @Async("asyncCustomTaskExecutor") CompletableFuture<Boolean> deleteObject(QueryContext qc); @Override @Async("asyncCustomTaskExecutor") CompletableFuture<Boolean> updateObject(QueryContext qc); @Override void authenticate(String username, String password); Map<String, AbstractWitsmlObject[]> getCap();  }