Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda-ariyaratne committed Jan 23, 2025
1 parent dab0291 commit 01626d5
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,11 @@ void testGetExtensionSchema() throws NoSuchFieldException, IllegalAccessExceptio
}

@Test
void testGetURI() throws NoSuchFieldException, IllegalAccessException {

Field uriField = SCIMSystemSchemaExtensionBuilder.class.getDeclaredField("extensionRootAttributeURI");
uriField.setAccessible(true);
String testURI = "testURI";
uriField.set(builder, testURI);
void testGetURI() {

String result = builder.getURI();
assertNotNull(result, "The getURI method should not return null.");
assertEquals(result, testURI, "The getURI method should return the correct URI.");
assertEquals(result, SYSTEM_USER_SCHEMA_URI, "The getURI method should return the correct URI.");
}

@Test
Expand Down Expand Up @@ -168,11 +163,11 @@ void setUp() throws NoSuchFieldException, IllegalAccessException, NoSuchMethodEx
constructor.setAccessible(true);
SCIMSystemSchemaExtensionBuilder newBuilderInstance = constructor.newInstance();

resetSingletonField("EXTENSION_ROOT_ATTRIBUTE_URI", SYSTEM_USER_SCHEMA_URI);
resetSingletonField("instance", newBuilderInstance);
resetSingletonField("extensionConfig", new HashMap<>());
resetSingletonField("attributeSchemas", new HashMap<>());

setInstanceField("extensionRootAttributeURI", SYSTEM_USER_SCHEMA_URI);
setInstanceField("extensionSchema", null);
setInstanceField("extensionRootAttributeName", null);
}
Expand Down

0 comments on commit 01626d5

Please sign in to comment.