@@ -99,6 +99,7 @@ public void setUp() {
9999
100100 @ Test
101101 public void testJson_RoleAssignment () {
102+ JsonPrinter .injectSettingsService (null , null , null , null , null , null , new MockRoleAssigneeService ());
102103 DataverseRole aRole = new DataverseRole ();
103104 PrivateUrlUser privateUrlUserIn = new PrivateUrlUser (42 );
104105 RoleAssignee anAssignee = privateUrlUserIn ;
@@ -116,6 +117,7 @@ public void testJson_RoleAssignment() {
116117
117118 @ Test
118119 public void testJson_PrivateUrl () {
120+ JsonPrinter .injectSettingsService (null , null , null , null , null , null , new MockRoleAssigneeService ());
119121 DataverseRole aRole = new DataverseRole ();
120122 PrivateUrlUser privateUrlUserIn = new PrivateUrlUser (42 );
121123 RoleAssignee anAssignee = privateUrlUserIn ;
@@ -199,7 +201,7 @@ public void testDatasetContactOutOfBoxNoPrivacy() {
199201 datasetContactField .setDatasetFieldCompoundValues (vals );
200202 fields .add (datasetContactField );
201203
202- JsonPrinter .injectSettingsService (null , null , null , null , null , null );
204+ JsonPrinter .injectSettingsService (null , null , null , null , null , null , null );
203205
204206 JsonObject jsonObject = JsonPrinter .json (block , fields ).build ();
205207 assertNotNull (jsonObject );
@@ -240,7 +242,7 @@ public void testDatasetContactWithPrivacy() {
240242 datasetContactField .setDatasetFieldCompoundValues (vals );
241243 fields .add (datasetContactField );
242244
243- JsonPrinter .injectSettingsService (new MockSettingsSvc (), null , null , null , null , null );
245+ JsonPrinter .injectSettingsService (new MockSettingsSvc (), null , null , null , null , null , null );
244246
245247 JsonObject jsonObject = JsonPrinter .json (block , fields ).build ();
246248 assertNotNull (jsonObject );
@@ -290,7 +292,7 @@ public void testDatasetFieldTypesWithChildren() {
290292
291293 block .setDatasetFieldTypes (datasetFieldTypes );
292294
293- JsonPrinter .injectSettingsService (new MockSettingsSvc (), null , null ,null , null , null );
295+ JsonPrinter .injectSettingsService (new MockSettingsSvc (), null , null ,null , null , null , null );
294296
295297 JsonObject jsonObject = JsonPrinter .json (block ).build ();
296298 assertNotNull (jsonObject );
@@ -355,6 +357,15 @@ public boolean isTrueForKey(SettingsServiceBean.Key key, boolean defaultValue) {
355357
356358 }
357359
360+ private static class MockRoleAssigneeService extends RoleAssigneeServiceBean {
361+
362+ @ Override
363+ public RoleAssignee getRoleAssignee (String identifier ) {
364+ return new PrivateUrlUser (42 );
365+ }
366+
367+ }
368+
358369 @ Test
359370 public void testEnum () throws JsonParseException {
360371 JsonArrayBuilder arr = JsonPrinter .enumsToJson (Arrays .asList (Type .REVOKEROLE , Type .ASSIGNROLE ));
0 commit comments