XlsDraftValidator implements DraftValidator { @Override public Result validate(DataSetMetadata dataSetMetadata) { if (StringUtils.isEmpty(dataSetMetadata.getSheetName())) { return new DraftValidator.Result(true); } return new DraftValidator.Result(false); }  @Override Result validate(DataSetMetadata dataSetMetadata);  }
@Test public void shouldValidateDraft() throws Exception { final DataSetMetadata metadata = metadataBuilder.metadata().id("#123").sheetName("toto").build(); final DraftValidator.Result result = validator.validate(metadata); assertThat(result.isDraft(), is(false)); }
@Test public void shouldNotValidateDraft() throws Exception { final DataSetMetadata metadata = metadataBuilder.metadata().id("#456").sheetName("").build(); final DraftValidator.Result result = validator.validate(metadata); assertThat(result.isDraft(), is(true)); }