Skip to content

Commit 98fbdef

Browse files
authored
V3 21 2 (#385)
* bump version: 3.21.2 * fix tests
1 parent 0096088 commit 98fbdef

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.21.2 (Jan 10, 2024)
2+
3+
- Documentation fixes
4+
5+
16
## 3.21.1 (Jan 8, 2024)
27

38
- Documentation fixes

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ NAMESPACE=terraform-providers
66
PKG_NAME=incapsula
77
BINARY=terraform-provider-${PKG_NAME}
88
# Whenever bumping provider version, please update the version in incapsula/client.go (line 27) as well.
9-
VERSION=3.21.1
9+
VERSION=3.21.2
1010

1111
# Mac Intel Chip
1212
OS_ARCH=darwin_amd64

incapsula/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type Client struct {
3434
func NewClient(config *Config) *Client {
3535
client := &http.Client{}
3636

37-
return &Client{config: config, httpClient: client, providerVersion: "3.21.1"}
37+
return &Client{config: config, httpClient: client, providerVersion: "3.21.2"}
3838
}
3939

4040
func (c *Client) CreateFormDataBody(bodyMap map[string]interface{}) ([]byte, string) {

incapsula/config_test.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,18 @@ func TestMissingBaseURL(t *testing.T) {
5252
}
5353

5454
func TestMissingBaseURLRev2(t *testing.T) {
55-
config := Config{APIID: "foo", APIKey: "bar", BaseURL: "foobar.com", BaseURLRev2: ""}
55+
config := Config{APIID: "foo", APIKey: "bar", BaseURL: "foobar.com", BaseURLRev2: "", BaseURLRev3: "foobar.com"}
56+
client, err := config.Client()
57+
if err == nil {
58+
t.Errorf("Should have received an error, got a client: %q", client)
59+
}
60+
if err.Error() != missingBaseURLRev2Message {
61+
t.Errorf("Should have received missing Base URL Revision 2 message, got: %s", err)
62+
}
63+
}
64+
65+
func TestMissingBaseURLRev3(t *testing.T) {
66+
config := Config{APIID: "foo", APIKey: "bar", BaseURL: "foobar.com", BaseURLRev2: "foobar.com", BaseURLRev3: ""}
5667
client, err := config.Client()
5768
if err == nil {
5869
t.Errorf("Should have received an error, got a client: %q", client)
@@ -63,7 +74,7 @@ func TestMissingBaseURLRev2(t *testing.T) {
6374
}
6475

6576
func TestMissingBaseURLAPI(t *testing.T) {
66-
config := Config{APIID: "foo", APIKey: "bar", BaseURL: "foobar.com", BaseURLRev2: "foobar.com", BaseURLAPI: ""}
77+
config := Config{APIID: "foo", APIKey: "bar", BaseURL: "foobar.com", BaseURLRev2: "foobar.com", BaseURLRev3: "foobar.com", BaseURLAPI: ""}
6778
client, err := config.Client()
6879
if err == nil {
6980
t.Errorf("Should have received an error, got a client: %q", client)
@@ -82,7 +93,7 @@ func TestInvalidCredentials(t *testing.T) {
8293
}))
8394
defer server.Close()
8495

85-
config := Config{APIID: "bad", APIKey: "bad", BaseURL: server.URL, BaseURLRev2: server.URL, BaseURLAPI: server.URL}
96+
config := Config{APIID: "bad", APIKey: "bad", BaseURL: server.URL, BaseURLRev2: server.URL, BaseURLRev3: server.URL, BaseURLAPI: server.URL}
8697
client, err := config.Client()
8798
if err == nil {
8899
t.Errorf("Should have received an error, got a client: %q", client)
@@ -101,7 +112,7 @@ func TestValidCredentials(t *testing.T) {
101112
}))
102113
defer server.Close()
103114

104-
config := Config{APIID: "good", APIKey: "good", BaseURL: server.URL, BaseURLRev2: server.URL, BaseURLAPI: server.URL}
115+
config := Config{APIID: "good", APIKey: "good", BaseURL: server.URL, BaseURLRev2: server.URL, BaseURLRev3: server.URL, BaseURLAPI: server.URL}
105116
client, err := config.Client()
106117
if err != nil {
107118
t.Errorf("Should not have received an error, got: %s", err)

0 commit comments

Comments
 (0)