Skip to content

Commit

Permalink
Renamed recordSituation->record and fixed schema tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 25, 2017
1 parent 84c6889 commit ef245d7
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
Expand Up @@ -1014,7 +1014,7 @@
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="recordSituation" type="tns:RecordSituationPolicyActionType" minOccurs="0">
<xsd:element name="record" type="tns:RecordPolicyActionType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Record action. The operation will proceed. Policy situation will be recorded for
Expand Down Expand Up @@ -1375,7 +1375,7 @@
</xsd:complexContent>
</xsd:complexType>

<xsd:complexType name="RecordSituationPolicyActionType">
<xsd:complexType name="RecordPolicyActionType">
<xsd:annotation>
<xsd:documentation>
TODO
Expand Down
Expand Up @@ -86,7 +86,7 @@ public static void assertFocusDefinition(ComplexTypeDefinition complexTypeDefini
PrismContainerDefinition<AssignmentType> assignmentContainer = complexTypeDefinition.findContainerDefinition(UserType.F_ASSIGNMENT);
PrismAsserts.assertDefinition(assignmentContainer, UserType.F_ASSIGNMENT, AssignmentType.COMPLEX_TYPE, 0, -1);
assertFalse("Assignment is runtime", assignmentContainer.isRuntimeSchema());
assertEquals("Assignment definition size", 21, assignmentContainer.getDefinitions().size());
assertEquals("Assignment definition size", 22, assignmentContainer.getDefinitions().size());

PrismContainerDefinition<ConstructionType> constructionContainer = assignmentContainer.findContainerDefinition(AssignmentType.F_CONSTRUCTION);
PrismAsserts.assertDefinition(constructionContainer, AssignmentType.F_CONSTRUCTION, ConstructionType.COMPLEX_TYPE, 0, 1);
Expand Down
Expand Up @@ -394,9 +394,9 @@
</policyConstraints>
<policySituation>http://sample.org/situations#incomplete-role-c1-to-c4</policySituation>
<policyActions>
<recordSituation>
<record>
<triggerStorageStrategy>full</triggerStorageStrategy>
</recordSituation>
</record>
</policyActions>
<focusSelector>
<type>RoleType</type>
Expand All @@ -412,9 +412,9 @@
</policyConstraints>
<policySituation>http://sample.org/situations#active-role-with-no-identifier</policySituation>
<policyActions>
<recordSituation>
<record>
<triggerStorageStrategy>none</triggerStorageStrategy>
</recordSituation>
</record>
</policyActions>
<focusSelector>
<type>RoleType</type>
Expand Down
Expand Up @@ -319,7 +319,7 @@ private <F extends FocusType> void evaluateRule(PolicyRuleEvaluationContext<F> c
}
ctx.triggerRule(triggers);
}
if (ctx.policyRule.isTriggered() && ctx.policyRule.getActions() != null && ctx.policyRule.getActions().getRecordSituation() != null) {
if (ctx.policyRule.isTriggered() && ctx.policyRule.getActions() != null && ctx.policyRule.getActions().getRecord() != null) {
ctx.record();
}
traceRuleEvaluationResult(ctx.policyRule, ctx);
Expand Down
Expand Up @@ -43,7 +43,7 @@
*/
@ContextConfiguration(locations = {"classpath:ctx-model-test-main.xml"})
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class TestPolicyMetadata extends AbstractLensTest {
public class TestPolicyState extends AbstractLensTest {

private static final String ROLE_JUDGE_POLICY_RULE_EXCLUSION_NAME = "criminal exclusion";

Expand Down Expand Up @@ -73,7 +73,7 @@ public void test100JackAssignRoleJudge() throws Exception {
TestUtil.displayTestTitle(this, TEST_NAME);

// GIVEN
Task task = taskManager.createTaskInstance(TestPolicyMetadata.class.getName() + "." + TEST_NAME);
Task task = taskManager.createTaskInstance(TestPolicyState.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();

// WHEN
Expand All @@ -100,7 +100,7 @@ public void test110JackAssignRolePirate() throws Exception {
TestUtil.displayTestTitle(this, TEST_NAME);

// GIVEN
Task task = taskManager.createTaskInstance(TestPolicyMetadata.class.getName() + "." + TEST_NAME);
Task task = taskManager.createTaskInstance(TestPolicyState.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();

// WHEN
Expand Down Expand Up @@ -130,7 +130,7 @@ public void test120RecomputeJack() throws Exception {
TestUtil.displayTestTitle(this, TEST_NAME);

// GIVEN
Task task = taskManager.createTaskInstance(TestPolicyMetadata.class.getName() + "." + TEST_NAME);
Task task = taskManager.createTaskInstance(TestPolicyState.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();

// WHEN
Expand Down
Expand Up @@ -30,7 +30,7 @@
</policyConstraints>
<policyActions>
<!-- no enforcement here -->
<recordSituation/>
<record/>
</policyActions>
</policyRule>
</assignment>
Expand Down
Expand Up @@ -31,7 +31,7 @@
</policyConstraints>
<policyActions>
<!-- no enforcement here -->
<recordSituation/>
<record/>
</policyActions>
</policyRule>
</assignment>
Expand Down
2 changes: 1 addition & 1 deletion model/model-impl/src/test/resources/lens/role-thief.xml
Expand Up @@ -28,7 +28,7 @@
</policyConstraints>
<policyActions>
<!-- no enforcement -->
<recordSituation/>
<record/>
</policyActions>
</policyRule>
</assignment>
Expand Down
2 changes: 1 addition & 1 deletion model/model-impl/testng-unit.xml
Expand Up @@ -72,7 +72,7 @@
<class name="com.evolveum.midpoint.model.impl.lens.TestPasswordPolicy"/>
<class name="com.evolveum.midpoint.model.impl.lens.TestPolicyRules"/>
<class name="com.evolveum.midpoint.model.impl.lens.TestPolicyRules2"/>
<class name="com.evolveum.midpoint.model.impl.lens.TestPolicyMetadata"/>
<class name="com.evolveum.midpoint.model.impl.lens.TestPolicyState"/>
<class name="com.evolveum.midpoint.model.impl.lens.TestProjectorPersona"/>
</classes>
</test>
Expand Down

0 comments on commit ef245d7

Please sign in to comment.