-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add schedule for alerts v2, add utilization settings in tests for sub accounts * remove commented out type
- Loading branch information
Showing
13 changed files
with
133 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ func TestIntegrationSubAccount_CreateSubAccount(t *testing.T) { | |
underTest, email, err := setupSubAccountsIntegrationTest() | ||
|
||
if assert.NoError(t, err) { | ||
createSubAccount := getCreatrOrUpdateSubAccount(email) | ||
createSubAccount := getCreateOrUpdateSubAccount(email) | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_create" | ||
|
||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
|
@@ -32,7 +32,7 @@ func TestIntegrationSubAccount_CreateSubAccountWithSharingAccount(t *testing.T) | |
accountId, err := test_utils.GetAccountId() | ||
assert.NoError(t, err) | ||
|
||
createSubAccount := getCreatrOrUpdateSubAccount(email) | ||
createSubAccount := getCreateOrUpdateSubAccount(email) | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_create_with_sharing_account" | ||
createSubAccount.SharingObjectsAccounts = []int32{int32(accountId)} | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
|
@@ -49,7 +49,7 @@ func TestIntegrationSubAccount_CreateSubAccountWithUtilization(t *testing.T) { | |
underTest, email, err := setupSubAccountsIntegrationTest() | ||
|
||
if assert.NoError(t, err) { | ||
createSubAccount := getCreatrOrUpdateSubAccount(email) | ||
createSubAccount := getCreateOrUpdateSubAccount(email) | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_create_utilization" | ||
createSubAccount.UtilizationSettings.UtilizationEnabled = strconv.FormatBool(true) | ||
createSubAccount.UtilizationSettings.FrequencyMinutes = 5 | ||
|
@@ -74,7 +74,7 @@ this test will be tested locally by uncommenting it, and not as part of the auto | |
// underTest, email, err := setupSubAccountsIntegrationTest() | ||
// | ||
// if assert.NoError(t, err) { | ||
// createSubAccount := getCreatrOrUpdateSubAccount(email) | ||
// createSubAccount := getCreateOrUpdateSubAccount(email) | ||
// createSubAccount.AccountName = createSubAccount.AccountName + "_create_flexible" | ||
// createSubAccount.Flexible = strconv.FormatBool(true) | ||
// createSubAccount.ReservedDailyGB = new(float32) | ||
|
@@ -94,7 +94,7 @@ this test will be tested locally by uncommenting it, and not as part of the auto | |
// underTest, email, err := setupSubAccountsIntegrationTest() | ||
// | ||
// if assert.NoError(t, err) { | ||
// createSubAccount := getCreatrOrUpdateSubAccount(email) | ||
// createSubAccount := getCreateOrUpdateSubAccount(email) | ||
// createSubAccount.AccountName = createSubAccount.AccountName + "_create_flexible" | ||
// createSubAccount.Flexible = strconv.FormatBool(true) | ||
// createSubAccount.ReservedDailyGB = new(float32) | ||
|
@@ -114,7 +114,7 @@ func TestIntegrationSubAccount_CreateSubAccountInvalidMail(t *testing.T) { | |
underTest, _, err := setupSubAccountsIntegrationTest() | ||
|
||
if assert.NoError(t, err) { | ||
createSubAccount := getCreatrOrUpdateSubAccount("[email protected]") | ||
createSubAccount := getCreateOrUpdateSubAccount("[email protected]") | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
|
||
assert.Error(t, err) | ||
|
@@ -126,7 +126,7 @@ func TestIntegrationSubAccount_CreateSubAccountNoMail(t *testing.T) { | |
underTest, _, err := setupSubAccountsIntegrationTest() | ||
|
||
if assert.NoError(t, err) { | ||
createSubAccount := getCreatrOrUpdateSubAccount("") | ||
createSubAccount := getCreateOrUpdateSubAccount("") | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
|
||
assert.Error(t, err) | ||
|
@@ -138,7 +138,7 @@ func TestIntegrationSubAccount_CreateSubAccountNoAccountName(t *testing.T) { | |
underTest, email, err := setupSubAccountsIntegrationTest() | ||
|
||
if assert.NoError(t, err) { | ||
createSubAccount := getCreatrOrUpdateSubAccount(email) | ||
createSubAccount := getCreateOrUpdateSubAccount(email) | ||
createSubAccount.AccountName = "" | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
|
||
|
@@ -151,7 +151,7 @@ func TestIntegrationSubAccount_CreateSubAccountNoRetention(t *testing.T) { | |
underTest, email, err := setupSubAccountsIntegrationTest() | ||
|
||
if assert.NoError(t, err) { | ||
createSubAccount := getCreatrOrUpdateSubAccount(email) | ||
createSubAccount := getCreateOrUpdateSubAccount(email) | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_no_retention" | ||
createSubAccount.RetentionDays = 0 | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ func TestSubAccount_CreateValidSubAccount(t *testing.T) { | |
fmt.Fprint(w, fixture("create_subaccount.json")) | ||
}) | ||
|
||
createSubAccount := getCreatrOrUpdateSubAccount("[email protected]") | ||
createSubAccount := getCreateOrUpdateSubAccount("[email protected]") | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_test_create" | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
assert.NoError(t, err) | ||
|
@@ -49,7 +49,7 @@ func TestSubAccount_CreateValidSubAccountAPIFail(t *testing.T) { | |
fmt.Fprint(w, fixture("create_subaccount_failed.txt")) | ||
}) | ||
|
||
createSubAccount := getCreatrOrUpdateSubAccount("[email protected]") | ||
createSubAccount := getCreateOrUpdateSubAccount("[email protected]") | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_test_create" | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
assert.Error(t, err) | ||
|
@@ -61,7 +61,7 @@ func TestSubAccount_CreateSubAccountNoEmail(t *testing.T) { | |
underTest, err, teardown := setupSubAccountsTest() | ||
defer teardown() | ||
|
||
createSubAccount := getCreatrOrUpdateSubAccount("") | ||
createSubAccount := getCreateOrUpdateSubAccount("") | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_test_create_no_email" | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
assert.Error(t, err) | ||
|
@@ -72,7 +72,7 @@ func TestSubAccount_CreateSubAccountNoAccountName(t *testing.T) { | |
underTest, err, teardown := setupSubAccountsTest() | ||
defer teardown() | ||
|
||
createSubAccount := getCreatrOrUpdateSubAccount("[email protected]") | ||
createSubAccount := getCreateOrUpdateSubAccount("[email protected]") | ||
createSubAccount.AccountName = "" | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
assert.Error(t, err) | ||
|
@@ -83,7 +83,7 @@ func TestSubAccount_CreateSubAccountNoRetentionDays(t *testing.T) { | |
underTest, err, teardown := setupSubAccountsTest() | ||
defer teardown() | ||
|
||
createSubAccount := getCreatrOrUpdateSubAccount("[email protected]") | ||
createSubAccount := getCreateOrUpdateSubAccount("[email protected]") | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_test_create_no_retention" | ||
createSubAccount.RetentionDays = 0 | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
|
@@ -95,7 +95,7 @@ func TestSubAccount_CreateSubAccountNoSharingAccount(t *testing.T) { | |
underTest, err, teardown := setupSubAccountsTest() | ||
defer teardown() | ||
|
||
createSubAccount := getCreatrOrUpdateSubAccount("[email protected]") | ||
createSubAccount := getCreateOrUpdateSubAccount("[email protected]") | ||
createSubAccount.AccountName = createSubAccount.AccountName + "_test_create_no_sharing" | ||
createSubAccount.SharingObjectsAccounts = nil | ||
subAccount, err := underTest.CreateSubAccount(createSubAccount) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ func TestSubAccount_UpdateValidSubAccount(t *testing.T) { | |
w.WriteHeader(http.StatusNoContent) | ||
}) | ||
|
||
updateSubAccount := getCreatrOrUpdateSubAccount("[email protected]") | ||
updateSubAccount := getCreateOrUpdateSubAccount("[email protected]") | ||
err = underTest.UpdateSubAccount(subAccountId, updateSubAccount) | ||
assert.NoError(t, err) | ||
} | ||
|
@@ -53,7 +53,7 @@ func TestSubAccount_UpdateSubAccountIdNotFound(t *testing.T) { | |
fmt.Fprint(w, fixture("update_subaccount_not_fount.txt")) | ||
}) | ||
|
||
updateSubAccount := getCreatrOrUpdateSubAccount("[email protected]") | ||
updateSubAccount := getCreateOrUpdateSubAccount("[email protected]") | ||
err = underTest.UpdateSubAccount(subAccountId, updateSubAccount) | ||
assert.Error(t, err) | ||
assert.Contains(t, err.Error(), "failed with missing sub account") | ||
|