@Test
void findDbmsType() {

    final Dbms dbms = mock(Dbms.class);
    when(dbms.getTypeName()).thenReturn("dbms_type_name");
    final Dbms dbms2 = mock(Dbms.class);
    when(dbms2.getTypeName()).thenReturn("non_existent_dbms_type_name");
    final DbmsType dbmsType = mock(DbmsType.class);
    when(dbmsType.getName()).thenReturn("dbms_type_name");
    final DbmsHandlerComponent dbmsHandlerComponent = mock(DbmsHandlerComponent.class);
    when(dbmsHandlerComponent.findByName("dbms_type_name")).thenReturn(Optional.of(dbmsType));
    when(dbmsHandlerComponent.findByName("non_existent_dbms_type_name")).thenReturn(Optional.empty());
    assertNotNull(DatabaseUtil.findDbmsType(dbmsHandlerComponent, dbms));
    assertThrows(SpeedmentException.class, () -> DatabaseUtil.findDbmsType(dbmsHandlerComponent, dbms2));
}