@@ -42,21 +42,24 @@ func (s *testSuite) TestNewManager() {
4242 connection string
4343 token string
4444 path string
45+ prefix string
4546 expectedError bool
4647 role credentials.Role
4748 }{
4849 {name : "missing token" , connection : s .connectionString , expectedError : true },
4950 {name : "missing address" , token : defaultToken , expectedError : true },
5051 {name : "invalid address reader" , token : defaultToken , connection : "http://non-existing:5000" , expectedError : true , role : credentials .RoleReader },
5152 {name : "invalid address writer" , token : defaultToken , connection : "http://non-existing:5000" , expectedError : true },
52- {name : "invalid mount path" , token : defaultToken , connection : s .connectionString , path : "non-existing" , expectedError : true , role : credentials . RoleWriter },
53+ {name : "invalid mount path" , token : defaultToken , connection : s .connectionString , path : "non-existing" , expectedError : true },
5354 {name : "valid connection reader" , connection : s .connectionString , token : defaultToken , role : credentials .RoleReader },
55+ {name : "valid connection reader with prefix" , connection : s .connectionString , token : defaultToken , role : credentials .RoleReader , prefix : "prefix" },
5456 {name : "valid connection" , connection : s .connectionString , token : defaultToken },
57+ {name : "valid connection with prefix" , connection : s .connectionString , token : defaultToken , prefix : "prefix" },
5558 }
5659
5760 for _ , tc := range testCases {
5861 s .Run (tc .name , func () {
59- opts := & vault.NewManagerOpts {AuthToken : tc .token , Address : tc .connection , MountPath : tc .path , Role : tc .role }
62+ opts := & vault.NewManagerOpts {AuthToken : tc .token , Address : tc .connection , MountPath : tc .path , Role : tc .role , SecretPrefix : tc . prefix }
6063 _ , err := vault .NewManager (opts )
6164 if tc .expectedError {
6265 assert .Error (err )
0 commit comments