Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrytfleung committed Jan 25, 2024
1 parent 6890d5e commit dc721d9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion extension/solarwindsapmsettingsextension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ func TestCreateExtensionUnAuthorizedKeyToAPMCollector(t *testing.T) {
ex.Shutdown(context.TODO())
}

func TestCreateExtensionMissingServiceNameToAPMCollector(t *testing.T) {
conf := &Config{
Endpoint: "apm.collector.na-01.cloud.solarwinds.com:443",
Key: "invalid:",
Interval: "60s",
}
ex := createAnExtension(conf, t)
ex.Shutdown(context.TODO())
}

func TestCreateExtensionUnAuthorizedKeyWithServiceNameToAPMCollector(t *testing.T) {
conf := &Config{
Endpoint: "apm.collector.na-01.cloud.solarwinds.com:443",
Expand All @@ -63,7 +73,7 @@ func TestCreateExtensionEmptyKeyWithServiceNameToAPMCollector(t *testing.T) {
func TestCreateExtensionNoSuchHost(t *testing.T) {
conf := &Config{
Endpoint: "apm.collector.na-99.cloud.solarwinds.com:443",
Key: "invalid",
Key: "invalid:service_name",
Interval: "60s",
}
ex := createAnExtension(conf, t)
Expand Down

0 comments on commit dc721d9

Please sign in to comment.