@@ -35,7 +35,7 @@ public class MountsTests {
3535 @ BeforeClass
3636 public static void setupClass () throws IOException , InterruptedException {
3737 container .initAndUnsealVault ();
38- container .setupBackendMounts ();
38+ container .setupBackendPki ();
3939 }
4040
4141 @ Test
@@ -45,9 +45,9 @@ public void testList() throws VaultException {
4545 final MountResponse response = vault .mounts ().list ();
4646 final Map <String , Mount > mounts = response .getMounts ();
4747
48- assertTrue (mounts .containsKey ("pki/ custom-path-1/" ));
49- assertTrue (mounts .containsKey ("pki/ custom-path-2/" ));
50- assertTrue (mounts .containsKey ("pki/ custom-path-3/" ));
48+ assertTrue (mounts .containsKey ("pki- custom-path-1/" ));
49+ assertTrue (mounts .containsKey ("pki- custom-path-2/" ));
50+ assertTrue (mounts .containsKey ("pki- custom-path-3/" ));
5151 }
5252
5353 @ Test
@@ -59,15 +59,15 @@ public void testEnable() throws VaultException {
5959 .maxLeaseTtl (TimeToLive .of (12 , TimeUnit .HOURS ))
6060 .description ("description for pki engine" );
6161
62- final MountResponse response = vault .mounts ().enable ("pki/ itest-path-1" , MountType .PKI , payload );
62+ final MountResponse response = vault .mounts ().enable ("pki- itest-path-1" , MountType .PKI , payload );
6363
6464 assertEquals (204 , response .getRestResponse ().getStatus ());
6565 }
6666
6767 @ Test
6868 public void testEnableExceptionAlreadyExist () throws VaultException {
6969 expectedEx .expect (VaultException .class );
70- expectedEx .expectMessage ("existing mount at " );
70+ expectedEx .expectMessage ("path is already in use " );
7171
7272 final Vault vault = container .getRootVault ();
7373
@@ -76,7 +76,7 @@ public void testEnableExceptionAlreadyExist() throws VaultException {
7676 .maxLeaseTtl (TimeToLive .of (168 , TimeUnit .HOURS ))
7777 .description ("description for pki engine" );
7878
79- vault .mounts ().enable ("pki/ custom-path-1" , MountType .PKI , payload );
79+ vault .mounts ().enable ("pki- custom-path-1" , MountType .PKI , payload );
8080 }
8181
8282 @ Test
@@ -91,7 +91,7 @@ public void testEnableExceptionNullType() throws VaultException {
9191 .maxLeaseTtl (TimeToLive .of (30 , TimeUnit .MINUTES ))
9292 .description ("description for pki engine" );
9393
94- vault .mounts ().enable ("pki/ itest-path-2" , null , payload );
94+ vault .mounts ().enable ("pki- itest-path-2" , null , payload );
9595 }
9696
9797 @ Test
@@ -103,7 +103,7 @@ public void testEnableExceptionNullTimeUnit() throws VaultException {
103103 final MountPayload payload = new MountPayload ()
104104 .defaultLeaseTtl (TimeToLive .of (7 , null ));
105105
106- vault .mounts ().enable ("pki/ itest-path-3" , MountType .PKI , payload );
106+ vault .mounts ().enable ("pki- itest-path-3" , MountType .PKI , payload );
107107 }
108108
109109 @ Test
@@ -116,14 +116,14 @@ public void testEnableExceptionInvalidTimeUnit() throws VaultException {
116116 final MountPayload payload = new MountPayload ()
117117 .defaultLeaseTtl (TimeToLive .of (7 , TimeUnit .DAYS ));
118118
119- vault .mounts ().enable ("pki/ itest-path-4" , MountType .PKI , payload );
119+ vault .mounts ().enable ("pki- itest-path-4" , MountType .PKI , payload );
120120 }
121121
122122 @ Test
123123 public void testDisable () throws VaultException {
124124 final Vault vault = container .getRootVault ();
125125
126- final MountResponse response = vault .mounts ().disable ("pki/ custom-path-3" );
126+ final MountResponse response = vault .mounts ().disable ("pki- custom-path-3" );
127127
128128 assertEquals (204 , response .getRestResponse ().getStatus ());
129129 }
@@ -136,9 +136,9 @@ public void testRead() throws VaultException {
136136 .defaultLeaseTtl (TimeToLive .of (360 , TimeUnit .MINUTES ))
137137 .maxLeaseTtl (TimeToLive .of (360 , TimeUnit .MINUTES ));
138138
139- vault .mounts ().enable ("pki/ predefined-path-1" , MountType .PKI , payload );
139+ vault .mounts ().enable ("pki- predefined-path-1" , MountType .PKI , payload );
140140
141- final MountResponse response = vault .mounts ().read ("pki/ predefined-path-1" );
141+ final MountResponse response = vault .mounts ().read ("pki- predefined-path-1" );
142142 final Mount mount = response .getMount ();
143143 final MountConfig config = mount .getConfig ();
144144
@@ -155,7 +155,7 @@ public void testReadExceptionNotFound() throws VaultException {
155155
156156 final Vault vault = container .getRootVault ();
157157
158- vault .mounts ().read ("pki/ non-existing-path" );
158+ vault .mounts ().read ("pki- non-existing-path" );
159159 }
160160
161161 @ Test
@@ -166,17 +166,17 @@ public void testTune() throws VaultException {
166166 .defaultLeaseTtl (TimeToLive .of (6 , TimeUnit .HOURS ))
167167 .maxLeaseTtl (TimeToLive .of (6 , TimeUnit .HOURS ));
168168
169- vault .mounts ().enable ("pki/ predefined-path-2" , MountType .PKI , enablePayload );
169+ vault .mounts ().enable ("pki- predefined-path-2" , MountType .PKI , enablePayload );
170170
171171 final MountPayload tunePayload = new MountPayload ()
172172 .defaultLeaseTtl (TimeToLive .of (12 , TimeUnit .HOURS ))
173173 .maxLeaseTtl (TimeToLive .of (12 , TimeUnit .HOURS ));
174174
175- final MountResponse tuneResponse = vault .mounts ().tune ("pki/ predefined-path-2" , tunePayload );
175+ final MountResponse tuneResponse = vault .mounts ().tune ("pki- predefined-path-2" , tunePayload );
176176
177177 assertEquals (204 , tuneResponse .getRestResponse ().getStatus ());
178178
179- final MountResponse response = vault .mounts ().read ("pki/ predefined-path-2" );
179+ final MountResponse response = vault .mounts ().read ("pki- predefined-path-2" );
180180 final Mount mount = response .getMount ();
181181 final MountConfig config = mount .getConfig ();
182182
@@ -195,6 +195,6 @@ public void testTuneExceptionNotFound() throws VaultException {
195195 .defaultLeaseTtl (TimeToLive .of (24 , TimeUnit .HOURS ))
196196 .maxLeaseTtl (TimeToLive .of (24 , TimeUnit .HOURS ));
197197
198- vault .mounts ().tune ("pki/ non-existing-path" , tunePayload );
198+ vault .mounts ().tune ("pki- non-existing-path" , tunePayload );
199199 }
200200}
0 commit comments