@Test public void testAddWarning() { String errorMsg = "Invalid VM State"; InvalidVmStateException ex = new InvalidVmStateException(errorMsg); StepEntity step = new StepEntity(); step.addWarning(ex); step.addWarning(new RpcException()); assertThat(step.getWarnings().size(), is(2)); StepWarningEntity firstError = step.getWarnings().get(0); assertThat(firstError.getCode(), is(ErrorCode.INVALID_VM_STATE.getCode())); assertThat(firstError.getMessage(), is(errorMsg)); StepWarningEntity secondError = step.getWarnings().get(1); assertThat(secondError.getCode(), is(ErrorCode.INTERNAL_ERROR.getCode())); assertThat(secondError.getMessage(), is("Request #null failed due to an internal error: null")); }
public void addWarning(Throwable t) { StepWarningEntity stepWarning = new StepWarningEntity(); fillStepErrorEntity(stepWarning, t); warnings.add(stepWarning); }
StepEntity extends BaseEntity { public void addWarning(Throwable t) { StepWarningEntity stepWarning = new StepWarningEntity(); fillStepErrorEntity(stepWarning, t); warnings.add(stepWarning); } }
StepEntity extends BaseEntity { public void addWarning(Throwable t) { StepWarningEntity stepWarning = new StepWarningEntity(); fillStepErrorEntity(stepWarning, t); warnings.add(stepWarning); }  }
StepEntity extends BaseEntity { public void addWarning(Throwable t) { StepWarningEntity stepWarning = new StepWarningEntity(); fillStepErrorEntity(stepWarning, t); warnings.add(stepWarning); }  @Override String getKind(); int getSequence(); void setSequence(int sequence); Operation getOperation(); void setOperation(Operation operation); String getOptions(); void setOptions(String options); List<StepErrorEntity> getErrors(); void addException(Throwable t); List<StepWarningEntity> getWarnings(); void addWarning(Throwable t); List<StepResourceEntity> getResources(); void addResource(BaseEntity entity); List<BaseEntity> getTransientResourceEntities(); void setTransientResourceEntities(List<BaseEntity> transientResourceEntities); List<T> getTransientResourceEntities(String kind); void addTransientResourceEntity(BaseEntity entity); void addResources(List<BaseEntity> entities); Object getTransientResource(String key); void createOrUpdateTransientResource(String key, Object value); Date getStartedTime(); void setStartedTime(Date startedTime); Date getQueuedTime(); void setQueuedTime(Date queuedTime); Date getEndTime(); void setEndTime(Date endTime); State getState(); void setState(State state); TaskEntity getTask(); void setTask(TaskEntity task); boolean isDisabled(); void setDisabled(boolean disabled); }
StepEntity extends BaseEntity { public void addWarning(Throwable t) { StepWarningEntity stepWarning = new StepWarningEntity(); fillStepErrorEntity(stepWarning, t); warnings.add(stepWarning); }  @Override String getKind(); int getSequence(); void setSequence(int sequence); Operation getOperation(); void setOperation(Operation operation); String getOptions(); void setOptions(String options); List<StepErrorEntity> getErrors(); void addException(Throwable t); List<StepWarningEntity> getWarnings(); void addWarning(Throwable t); List<StepResourceEntity> getResources(); void addResource(BaseEntity entity); List<BaseEntity> getTransientResourceEntities(); void setTransientResourceEntities(List<BaseEntity> transientResourceEntities); List<T> getTransientResourceEntities(String kind); void addTransientResourceEntity(BaseEntity entity); void addResources(List<BaseEntity> entities); Object getTransientResource(String key); void createOrUpdateTransientResource(String key, Object value); Date getStartedTime(); void setStartedTime(Date startedTime); Date getQueuedTime(); void setQueuedTime(Date queuedTime); Date getEndTime(); void setEndTime(Date endTime); State getState(); void setState(State state); TaskEntity getTask(); void setTask(TaskEntity task); boolean isDisabled(); void setDisabled(boolean disabled); static final String KIND; }