Skip to content

Commit 57742bd

Browse files
author
Pedro Montiel
committed
feedback from review
1 parent 4f76a40 commit 57742bd

File tree

3 files changed

+50
-10
lines changed

3 files changed

+50
-10
lines changed

sumologic/data_source_sumologic_cse_log_mapping_vendor_product.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func dataSourceCSELogMappingVendorAndProductRead(d *schema.ResourceData, meta in
4141

4242
if vendorAndProduct == nil {
4343
d.SetId("")
44-
return fmt.Errorf("Vendor product not found, removing from state: %v - %v", id, err)
44+
return fmt.Errorf("Vendor product not found, removing from state: %v", id)
4545
}
4646

4747
d.SetId(vendorAndProduct.GUID)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package sumologic
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
7+
)
8+
9+
func TestDataSourceCSELogMappingVendorProduct_basic(t *testing.T) {
10+
resource.Test(t, resource.TestCase{
11+
PreCheck: func() { testAccPreCheck(t) },
12+
Providers: testAccProviders,
13+
Steps: []resource.TestStep{
14+
{
15+
Config: testDataSourceSumologicCSELogMappingVendorProduct,
16+
Check: resource.ComposeTestCheckFunc(
17+
testDataSourceSumologicCSELogMappingVendorProductCheck("data.sumologic_cse_log_mapping_vendor_product.web_gateway"),
18+
),
19+
},
20+
},
21+
})
22+
}
23+
24+
func testDataSourceSumologicCSELogMappingVendorProductCheck(name string) resource.TestCheckFunc {
25+
return resource.ComposeTestCheckFunc(
26+
resource.TestCheckResourceAttrSet(name, "product"),
27+
resource.TestCheckResourceAttr(name, "product", "Web Gateway"),
28+
resource.TestCheckResourceAttrSet(name, "vendor"),
29+
resource.TestCheckResourceAttr(name, "vendor", "McAfee"),
30+
resource.TestCheckResourceAttrSet(name, "guid"),
31+
)
32+
}
33+
34+
var testDataSourceSumologicCSELogMappingVendorProduct = `
35+
data "sumologic_cse_log_mapping_vendor_product" "web_gateway" {
36+
product = "Web Gateway"
37+
vendor = "McAfee"
38+
}
39+
`

sumologic/sumologic_client.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ type Client struct {
2828
var ProviderVersion string
2929

3030
var endpoints = map[string]string{
31-
"us1": "https://api.sumologic.com/api/",
32-
"us2": "https://api.us2.sumologic.com/api/",
33-
"fed": "https://api.fed.sumologic.com/api/",
34-
"eu": "https://api.eu.sumologic.com/api/",
35-
"au": "https://api.au.sumologic.com/api/",
36-
"de": "https://api.de.sumologic.com/api/",
37-
"jp": "https://api.jp.sumologic.com/api/",
38-
"ca": "https://api.ca.sumologic.com/api/",
39-
"in": "https://api.in.sumologic.com/api/",
31+
"us1": "https://api.sumologic.com/api/",
32+
"us2": "https://api.us2.sumologic.com/api/",
33+
"fed": "https://api.fed.sumologic.com/api/",
34+
"eu": "https://api.eu.sumologic.com/api/",
35+
"au": "https://api.au.sumologic.com/api/",
36+
"de": "https://api.de.sumologic.com/api/",
37+
"jp": "https://api.jp.sumologic.com/api/",
38+
"ca": "https://api.ca.sumologic.com/api/",
39+
"in": "https://api.in.sumologic.com/api/",
40+
"nite": "https://nite-api.sumologic.net/api/",
4041
}
4142

4243
var rateLimiter = time.NewTicker(time.Minute / 240)

0 commit comments

Comments
 (0)