-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed or improved trace-level logging statements which were unnecessary or generated hard-to-read logs
- Loading branch information
Showing
5 changed files
with
75 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package datastore | ||
|
||
import ( | ||
"encoding/json" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/vmware-labs/multi-tenant-persistence-for-saas/pkg/dbrole" | ||
"testing" | ||
) | ||
|
||
func TestDbUserSpecString(t *testing.T) { | ||
assert := assert.New(t) | ||
dbUserSpec := dbUserSpec{ | ||
username: dbrole.WRITER, | ||
password: "1234546789", | ||
policyName: "policy_name", | ||
commands: []string{"SELECT", "INSERT", "UPDATE", "DELETE"}, | ||
existingRowsCond: "true", | ||
newRowsCond: "true", | ||
} | ||
|
||
dbUserSpecJson := dbUserSpec.String() | ||
assert.True(json.Valid([]byte(dbUserSpecJson)), "Expected string version of dbUserSpec to be a valid JSON") | ||
assert.NotEqual("{}", dbUserSpecJson, "Expected string version of dbUserSpec not to be an empty JSON struct") | ||
assert.NotContains(dbUserSpecJson, dbUserSpec.password, "Expected string version of dbUserSpec not to contain DB user's password") | ||
} |
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