@@ -157,29 +157,33 @@ public void prepareServer() {
157
157
logger .debug ("Test run container content: {}" , testRunContainer .getContentAsTurtle ());
158
158
logger .debug ("Test run container access controls: {}" , testRunContainer .getAccessDataset ());
159
159
160
- // check that we can change the access control of a resource so we know those tests can run
161
- final var aclTestContainer = testRunContainer .reserveContainer ("acltest" );
162
- try {
163
- aclTestContainer .instantiate ();
164
- final var builder = aclTestContainer .getAccessDatasetBuilder ();
165
- final var bobReadAcl = builder
166
- .setAgentAccess (
167
- aclTestContainer .getUrl ().toString (),
168
- config .getWebIds ().get (HttpConstants .BOB ),
169
- List .of ("read" )
170
- ).build ();
171
- aclTestContainer .setAccessDataset (bobReadAcl ); // MOCK THIS PASS/FAIL
172
- logger .info ("Confirmed we can create a container [{}] and set ACLs on it" , aclTestContainer .getUrl ());
173
- } catch (TestHarnessException | TestHarnessApiException ex ) {
174
- logger .warn ("Failed to create a container [{}] and set ACLs on it: {}" ,
175
- aclTestContainer .getUrl (), ex .getMessage ());
176
- throw ex ;
177
- }
160
+ testAccessControlCapability ();
178
161
} catch (TestHarnessException | RuntimeException e ) {
179
162
throw new TestHarnessInitializationException ("Failed to prepare server" , e );
180
163
}
181
164
}
182
165
166
+ private void testAccessControlCapability () throws TestHarnessException {
167
+ // check that we can change the access control of a resource so we know those tests can run
168
+ final var aclTestContainer = testRunContainer .reserveContainer ("acltest" );
169
+ try {
170
+ aclTestContainer .instantiate ();
171
+ final var builder = aclTestContainer .getAccessDatasetBuilder ();
172
+ final var bobReadAcl = builder
173
+ .setAgentAccess (
174
+ aclTestContainer .getUrl ().toString (),
175
+ config .getWebIds ().get (HttpConstants .BOB ),
176
+ List .of ("read" )
177
+ ).build ();
178
+ aclTestContainer .setAccessDataset (bobReadAcl ); // MOCK THIS PASS/FAIL
179
+ logger .info ("Confirmed we can create a container [{}] and set ACLs on it" , aclTestContainer .getUrl ());
180
+ } catch (TestHarnessException | TestHarnessApiException ex ) {
181
+ // don't throw an error as we might not be running access control tests
182
+ logger .warn ("Failed to create a container [{}] and set ACLs on it: {}" ,
183
+ aclTestContainer .getUrl (), ex .getMessage ());
184
+ }
185
+ }
186
+
183
187
// Determine the ACL mode the server has implemented
184
188
private void determineAccessControlImplementation (final SolidClientProvider ownerClient )
185
189
throws TestHarnessException {
0 commit comments