More SourceDao tests
package marquez.db;
+import static marquez.common.models.ModelGenerator.newSourceName;
+import static marquez.db.models.ModelGenerator.newRowUuid;
import static marquez.db.models.ModelGenerator.newSourceRow;
import static marquez.db.models.ModelGenerator.newSourceRows;
import static org.assertj.core.api.Assertions.assertThat;
@@ -85,6 +87,12 @@ public class SourceDaoTest {
assertThat(row).isPresent();
}
+ @Test
+ public void testFindBy_uuidNotFound() {
+ final Optional<SourceRow> row = sourceDao.findBy(newRowUuid());
+ assertThat(row).isEmpty();
+ }
+
@Test
public void testFindBy_name() {
final SourceRow newRow = newSourceRow();
@@ -94,6 +102,12 @@ public class SourceDaoTest {
assertThat(row).isPresent();
}
+ @Test
+ public void testFindBy_nameNotFound() {
+ final Optional<SourceRow> row = sourceDao.findBy(newSourceName().getValue());
+ assertThat(row).isEmpty();
+ }
+
@Test
public void testFindAll() {
final List<SourceRow> newRows = newSourceRows(4);
