Skip to content

Commit a7ab968

Browse files
committed
[+] add test coverage for Sources.ResolveDatabases()
1 parent 92aa4df commit a7ab968

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

internal/sources/conn_test.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,21 @@ func TestMonitoredDatabases_SyncFromReader_error(t *testing.T) {
217217

218218
func TestMonitoredDatabases_SyncFromReader(t *testing.T) {
219219
db, _ := pgxmock.NewPool()
220-
src := sources.Source{
221-
Name: "test",
222-
Kind: sources.SourcePostgres,
223-
IsEnabled: true,
224-
ConnStr: "postgres://user:password@localhost:5432/mydatabase",
220+
221+
reader := testSourceReader{Sources: sources.Sources{
222+
sources.Source{
223+
Name: "test",
224+
Kind: sources.SourcePostgres,
225+
IsEnabled: true,
226+
ConnStr: "postgres://user:password@localhost:5432/mydatabase",
227+
},
228+
sources.Source{
229+
Name: "test2",
230+
Kind: sources.SourcePostgres,
231+
IsEnabled: false,
232+
},
233+
},
225234
}
226-
reader := testSourceReader{Sources: sources.Sources{src}}
227235
// first read the sources
228236
mds, _ := reader.GetSources()
229237
assert.NotNil(t, mds, "GetSources() = nil, want not nil")

0 commit comments

Comments
 (0)