Class UpdateApiOpTests
- java.lang.Object
-
- org.identityconnectors.contract.test.ContractTestBase
-
- org.identityconnectors.contract.test.ObjectClassRunner
-
- org.identityconnectors.contract.test.UpdateApiOpTests
-
public class UpdateApiOpTests extends ObjectClassRunner
Contract test ofUpdateApiOp
.
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
MODIFIED
static String
TEST_NAME
-
Fields inherited from class org.identityconnectors.contract.test.ContractTestBase
_connFacade, LOG_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description UpdateApiOpTests()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Class<? extends APIOperation>>
getAPIOperations()
Ask the subclasses for theAPIOperation
.protected static Collection<String>
getSkippedAttributesForUpdateToNullValue()
String
getTestName()
Gets Test nameprotected static Set<Attribute>
mergeAttributeSets(Set<Attribute> attrSet1, Set<Attribute> attrSet2)
Returns new attribute set which contains all attributes from both sets.protected void
testRun(ObjectClass objectClass)
This method will be called configured number of timesvoid
testUpdateFailUnsupportedAttribute(ObjectClass objectClass)
Tests update method with invalid Attribute, RuntimeException is expected connector developers can set the value of unsupported attribute using test property:testsuite.Create.unsupportedAttributeName
void
testUpdateToNull(ObjectClass objectClass)
The test verifies that connector doesn't throw NullPointerException or some other unexpected behavior when passed null as attribute value.void
testUpdateToSameAttributes(ObjectClass objectClass)
Tests create of two different objects and then update one to the same attributes as the second.-
Methods inherited from class org.identityconnectors.contract.test.ObjectClassRunner
getObjectClassInfo, getOperationOptionsByOp, getSchema, isObjectClassSupported, objectClasses, testContract
-
Methods inherited from class org.identityconnectors.contract.test.ContractTestBase
dispose, getConnectorFacade, getDataProvider, init
-
-
-
-
Field Detail
-
MODIFIED
protected static final String MODIFIED
- See Also:
- Constant Field Values
-
TEST_NAME
public static final String TEST_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAPIOperations
public Set<Class<? extends APIOperation>> getAPIOperations()
Ask the subclasses for theAPIOperation
. Method returns set of required API operations that are prerequisites for running certain contract test.- Specified by:
getAPIOperations
in classContractTestBase
-
testRun
protected void testRun(ObjectClass objectClass)
This method will be called configured number of times This tests an proper updating of attributes. All new attributes' values in given set for update are valid. Test procedure: 1) Create object. 2) Get this created object + fill it with values 3) Get a set of new values for updateable attributes - replacing all attributes' values (no add or delete) 4) Update uid and replaces values of attributes 5) Verify if the object has new values of attributes 6) ---- JUMPS TO FINALLY SECTION ---- see in TODOs- Specified by:
testRun
in classObjectClassRunner
-
testUpdateToNull
@ParameterizedTest @MethodSource("objectClasses") public void testUpdateToNull(ObjectClass objectClass)
The test verifies that connector doesn't throw NullPointerException or some other unexpected behavior when passed null as attribute value. Test passes null values only for non-required non-special updateable attributes. Test procedure: 1) Test if the required API operaions are supported by given objectClass. 2) Set all attributes' values to null If you want to skip some attributes from being set to null list them in Update.updateToNullValue.skippedAttributes property in groovy.config 3) Try to update the object with property's value = null -> IF no exception, property has been removed or set to null 4) Check if the property has been really removed or set to null 5) TODO something went wrong because the value has not been set to null value or removed. The value of nulled property pesisted.
-
testUpdateToSameAttributes
@ParameterizedTest @MethodSource("objectClasses") public void testUpdateToSameAttributes(ObjectClass objectClass)
Tests create of two different objects and then update one to the same attributes as the second. Test that updated object did not update uid to the same value as the first object.
-
getTestName
public String getTestName()
Description copied from class:ObjectClassRunner
Gets Test name- Specified by:
getTestName
in classObjectClassRunner
- Returns:
- Test Name
-
testUpdateFailUnsupportedAttribute
@ParameterizedTest @MethodSource("objectClasses") public void testUpdateFailUnsupportedAttribute(ObjectClass objectClass)
Tests update method with invalid Attribute, RuntimeException is expected connector developers can set the value of unsupported attribute using test property:testsuite.Create.unsupportedAttributeName
-
mergeAttributeSets
protected static Set<Attribute> mergeAttributeSets(Set<Attribute> attrSet1, Set<Attribute> attrSet2)
Returns new attribute set which contains all attributes from both sets. If attribute with the same name is present in both sets then its values are merged.
-
getSkippedAttributesForUpdateToNullValue
protected static Collection<String> getSkippedAttributesForUpdateToNullValue()
-
-