@Test
public void shouldWatchForFileChanges() {

    writeConfigLines("my.dataSource.jdbcUrl=jdbc:datamastery:example",
        "my.dataSource.jdbcUsername=sa",
        "my.dataSource.jdbcPassword=");
    observer.onConfigChange(new DummyDataSourceConfigListener(
            "my.dataSource",
            dataSource -> this.dataSource = dataSource
    ));
    assertThat(dataSource).isEqualToComparingFieldByField(new DummyDataSource(
            "jdbc:datamastery:example", "sa", ""
    ));
    dataSource = null;
    writeConfigLine("otherConfig=something");
    assertThat(dataSource).isNull();
    writeConfigLines("my.dataSource.jdbcUrl=jdbc:datamastery:UPDATED",
        "my.dataSource.jdbcUsername=sa",
        "my.dataSource.jdbcPassword=");
    assertThat(dataSource).isEqualToComparingFieldByField(new DummyDataSource(
            "jdbc:datamastery:UPDATED", "sa", ""
    ));
}