@@ -105,6 +105,7 @@ public void setUp() {
105105
106106 @ Test
107107 public void testJson_RoleAssignment () {
108+ JsonPrinter .injectSettingsService (null , null , null , null , null , null , new MockRoleAssigneeService ());
108109 DataverseRole aRole = new DataverseRole ();
109110 PrivateUrlUser privateUrlUserIn = new PrivateUrlUser (42 );
110111 RoleAssignee anAssignee = privateUrlUserIn ;
@@ -122,6 +123,7 @@ public void testJson_RoleAssignment() {
122123
123124 @ Test
124125 public void testJson_PrivateUrl () {
126+ JsonPrinter .injectSettingsService (null , null , null , null , null , null , new MockRoleAssigneeService ());
125127 DataverseRole aRole = new DataverseRole ();
126128 PrivateUrlUser privateUrlUserIn = new PrivateUrlUser (42 );
127129 RoleAssignee anAssignee = privateUrlUserIn ;
@@ -205,7 +207,7 @@ public void testDatasetContactOutOfBoxNoPrivacy() {
205207 datasetContactField .setDatasetFieldCompoundValues (vals );
206208 fields .add (datasetContactField );
207209
208- JsonPrinter .injectSettingsService (null , null , null , null , null , null );
210+ JsonPrinter .injectSettingsService (null , null , null , null , null , null , null );
209211
210212 JsonObject jsonObject = JsonPrinter .json (block , fields ).build ();
211213 assertNotNull (jsonObject );
@@ -246,7 +248,7 @@ public void testDatasetContactWithPrivacy() {
246248 datasetContactField .setDatasetFieldCompoundValues (vals );
247249 fields .add (datasetContactField );
248250
249- JsonPrinter .injectSettingsService (new MockSettingsSvc (), null , null , null , null , null );
251+ JsonPrinter .injectSettingsService (new MockSettingsSvc (), null , null , null , null , null , null );
250252
251253 JsonObject jsonObject = JsonPrinter .json (block , fields ).build ();
252254 assertNotNull (jsonObject );
@@ -296,7 +298,7 @@ public void testDatasetFieldTypesWithChildren() {
296298
297299 block .setDatasetFieldTypes (datasetFieldTypes );
298300
299- JsonPrinter .injectSettingsService (new MockSettingsSvc (), null , null ,null , null , null );
301+ JsonPrinter .injectSettingsService (new MockSettingsSvc (), null , null ,null , null , null , null );
300302
301303 JsonObject jsonObject = JsonPrinter .json (block ).build ();
302304 assertNotNull (jsonObject );
@@ -361,6 +363,15 @@ public boolean isTrueForKey(SettingsServiceBean.Key key, boolean defaultValue) {
361363
362364 }
363365
366+ private static class MockRoleAssigneeService extends RoleAssigneeServiceBean {
367+
368+ @ Override
369+ public RoleAssignee getRoleAssignee (String identifier ) {
370+ return new PrivateUrlUser (42 );
371+ }
372+
373+ }
374+
364375 @ Test
365376 public void testEnum () throws JsonParseException {
366377 JsonArrayBuilder arr = JsonPrinter .enumsToJson (Arrays .asList (Type .REVOKEROLE , Type .ASSIGNROLE ));
0 commit comments