Skip to content

Commit

Permalink
Remove forgotten traced(..) calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Feb 14, 2023
1 parent 83890c8 commit 263828e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void test100TwoAssignmentsOfIdempotentRoleOneRemoved() throws Exception {
OperationResult result = task.getResult();

// @formatter:off
UserType user = new UserType(prismContext)
UserType user = new UserType()
.name("test100")
.beginAssignment()
.description("a1")
Expand All @@ -98,12 +98,12 @@ public void test100TwoAssignmentsOfIdempotentRoleOneRemoved() throws Exception {
addObject(user.asPrismObject(), null, task, result);

when();
traced(() -> executeChanges(
executeChanges(
deltaFor(UserType.class)
.item(UserType.F_ASSIGNMENT)
.delete(user.getAssignment().get(1).clone())
.asObjectDelta(user.getOid()),
null, task, result));
null, task, result);

then();
assertSuccess(result);
Expand Down Expand Up @@ -132,7 +132,7 @@ public void test110TwoIndirectAssignmentsOfIdempotentRoleOneRemoved() throws Exc
OperationResult result = task.getResult();

// @formatter:off
UserType user = new UserType(prismContext)
UserType user = new UserType()
.name("test110")
.beginAssignment()
.description("a1")
Expand All @@ -154,12 +154,12 @@ public void test110TwoIndirectAssignmentsOfIdempotentRoleOneRemoved() throws Exc
// @formatter:on

when();
traced(() -> executeChanges(
executeChanges(
deltaFor(UserType.class)
.item(UserType.F_ASSIGNMENT)
.delete(user.getAssignment().get(1).clone())
.asObjectDelta(user.getOid()),
null, task, result));
null, task, result);

then();
assertSuccess(result);
Expand Down Expand Up @@ -194,7 +194,7 @@ public void test120TwoAssignmentsOfIdempotentRoleOneDisabled() throws Exception

when();
// @formatter:off
UserType user = new UserType(prismContext)
UserType user = new UserType()
.name("test120")
.beginAssignment()
.description("disabled")
Expand Down Expand Up @@ -242,7 +242,7 @@ public void test130TwoIndirectAssignmentsOfIdempotentRoleOneDisabled() throws Ex

when();
// @formatter:off
UserType user = new UserType(prismContext)
UserType user = new UserType()
.name("test130")
.beginAssignment()
.targetRef(ROLE_INDUCING_IDEMPOTENT.oid, RoleType.COMPLEX_TYPE)
Expand All @@ -269,7 +269,7 @@ public void test130TwoIndirectAssignmentsOfIdempotentRoleOneDisabled() throws Ex
}

private ActivationType disabled() {
return new ActivationType(prismContext)
return new ActivationType()
.administrativeStatus(ActivationStatusType.DISABLED);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -663,15 +663,15 @@ public void test380MakeSwordDummy() throws Exception {
OperationResult result = task.getResult();

when("sword is switched to dummy archetype");
traced( () -> executeChanges(
executeChanges(
prismContext.deltaFor(ServiceType.class)
.item(ServiceType.F_ASSIGNMENT)
.delete(new AssignmentType()
.targetRef(ARCHETYPE_DEVICE.oid, ArchetypeType.COMPLEX_TYPE))
.add(new AssignmentType()
.targetRef(ARCHETYPE_DUMMY.oid, ArchetypeType.COMPLEX_TYPE))
.asObjectDelta(SERVICE_SWORD.oid),
null, task, result) );
null, task, result);

then();
assertSuccess(result);
Expand Down Expand Up @@ -712,15 +712,15 @@ public void test390SwitchServiceArchetype() throws Exception {
addObject(user390, task, result);

when("spoon is switched to 'device' archetype");
traced( () -> executeChanges(
executeChanges(
prismContext.deltaFor(ServiceType.class)
.item(ServiceType.F_ASSIGNMENT)
.delete(new AssignmentType()
.targetRef(ARCHETYPE_DUMMY.oid, ArchetypeType.COMPLEX_TYPE))
.add(new AssignmentType()
.targetRef(ARCHETYPE_DEVICE.oid, ArchetypeType.COMPLEX_TYPE))
.asObjectDelta(spoon390.getOid()),
null, task, result) );
null, task, result);

then();
assertSuccess(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public void test320GiveMagnusExtraValuesAndModifyUser() throws Exception {
.asObjectDelta(USER_MAGNUS.oid);

when();
traced(() -> executeChanges(delta, null, task, result));
executeChanges(delta, null, task, result);

then();
assertSuccess(task);
Expand Down Expand Up @@ -403,7 +403,7 @@ public void test370GiveVladimirExtraValuesAndModifyUser() throws Exception {
.asObjectDelta(USER_VLADIMIR.oid);

when();
traced(() -> executeChanges(delta, null, task, result));
executeChanges(delta, null, task, result);

then();
assertSuccess(task);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
public class TestOrgStructMeta extends TestOrgStruct {

private static final File OBJECT_TEMPLATE_ORG_FILE = new File(TEST_DIR, "object-template-org.xml");
protected static final String OBJECT_TEMPLATE_ORG_OID = "3e62558c-ca0f-11e3-ba83-001e8c717e5b";
private static final String OBJECT_TEMPLATE_ORG_OID = "3e62558c-ca0f-11e3-ba83-001e8c717e5b";

protected static final File ROLE_META_FUNCTIONAL_ORG_FILE = new File(TEST_DIR, "role-meta-functional-org.xml");
protected static final String ROLE_META_FUNCTIONAL_ORG_OID = "74aac2c8-ca0f-11e3-bb29-001e8c717e5b";
private static final File ROLE_META_FUNCTIONAL_ORG_FILE = new File(TEST_DIR, "role-meta-functional-org.xml");
private static final String ROLE_META_FUNCTIONAL_ORG_OID = "74aac2c8-ca0f-11e3-bb29-001e8c717e5b";

protected static final File ROLE_ORGANIZED_FILE = new File(TEST_DIR, "role-organized.xml");
protected static final String ROLE_ORGANIZED_OID = "12345111-1111-2222-1111-121212111001";
private static final File ROLE_ORGANIZED_FILE = new File(TEST_DIR, "role-organized.xml");
private static final String ROLE_ORGANIZED_OID = "12345111-1111-2222-1111-121212111001";

@Override
protected boolean doAddOrgstruct() {
Expand Down Expand Up @@ -96,6 +96,7 @@ protected ResultHandler<OrgType> getOrgSanityCheckHandler() {
*/
@Override
protected void addOrgStruct() throws Exception {
//noinspection unchecked,rawtypes
List<PrismObject<OrgType>> orgs = (List) PrismTestUtil.parseObjects(ORG_MONKEY_ISLAND_FILE);

// WHEN
Expand All @@ -111,19 +112,19 @@ protected void addOrgStruct() throws Exception {
protected void assertUserOrg(PrismObject<UserType> user, String... orgOids) throws Exception {
super.assertUserOrg(user, orgOids);
List<PolyStringType> userOrganizations = user.asObjectable().getOrganization();
List<PolyStringType> expextedOrgs = new ArrayList<>();
List<PolyStringType> expectedOrgs = new ArrayList<>();
for (String orgOid: orgOids) {
PrismObject<OrgType> org = getObject(OrgType.class, orgOid);
List<String> orgType = FocusTypeUtil.determineSubTypes(org);
if (orgType.contains("functional")) {
PolyStringType orgName = org.asObjectable().getName();
assertTrue("Value "+orgName+" not found in user organization property: "+userOrganizations, userOrganizations.contains(orgName));
if (!expextedOrgs.contains(orgName)) {
expextedOrgs.add(orgName);
if (!expectedOrgs.contains(orgName)) {
expectedOrgs.add(orgName);
}
}
}
assertEquals("Wrong number of user organization property values: "+userOrganizations, expextedOrgs.size(), userOrganizations.size());
assertEquals("Wrong number of user organization property values: "+userOrganizations, expectedOrgs.size(), userOrganizations.size());
}

@Override
Expand Down Expand Up @@ -250,7 +251,7 @@ public void test810JackAssignScummBarOrganized() throws Exception {
.createModifyDelta(USER_JACK_OID, modifications, UserType.class);

// WHEN
traced(() -> executeChanges(userDelta, null, task, result));
executeChanges(userDelta, null, task, result);

// THEN
result.computeStatus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ public void test130JackAssignRolePirateWithSeaInAssignment() throws Exception {

PrismContainer<?> extension = getAssignmentExtensionInstance();
PrismSchema piracySchema = getPiracySchema();
//noinspection unchecked
PrismPropertyDefinition<String> seaPropDef = piracySchema.findPropertyDefinitionByElementName(PIRACY_SEA_QNAME);
PrismProperty<String> seaProp = seaPropDef.instantiate();
seaProp.setRealValue("Caribbean");
Expand Down Expand Up @@ -474,6 +475,7 @@ public void test132JackUnAssignRolePirateWithSeaInAssignment() throws Exception

PrismContainer<?> extension = getAssignmentExtensionInstance();
PrismSchema piracySchema = getPiracySchema();
//noinspection unchecked
PrismPropertyDefinition<String> seaPropDef = piracySchema.findPropertyDefinitionByElementName(PIRACY_SEA_QNAME);
PrismProperty<String> seaProp = seaPropDef.instantiate();
seaProp.setRealValue("Caribbean");
Expand Down Expand Up @@ -588,6 +590,7 @@ public void test137JackAssignRoleAdriaticPirateWithSeaInAssignment() throws Exce

PrismContainer<?> extension = getAssignmentExtensionInstance();
PrismSchema piracySchema = getPiracySchema();
//noinspection unchecked
PrismPropertyDefinition<String> seaPropDef = piracySchema.findPropertyDefinitionByElementName(PIRACY_SEA_QNAME);
PrismProperty<String> seaProp = seaPropDef.instantiate();
seaProp.setRealValue("Caribbean");
Expand Down Expand Up @@ -623,6 +626,7 @@ public void test139JackUnAssignRoleAdriaticPirateWithSeaInAssignment() throws Ex

PrismContainer<?> extension = getAssignmentExtensionInstance();
PrismSchema piracySchema = getPiracySchema();
//noinspection unchecked
PrismPropertyDefinition<String> seaPropDef = piracySchema.findPropertyDefinitionByElementName(PIRACY_SEA_QNAME);
PrismProperty<String> seaProp = seaPropDef.instantiate();
seaProp.setRealValue("Caribbean");
Expand Down Expand Up @@ -698,6 +702,7 @@ public void test147JackAssignRoleBlackSeaPirateWithSeaInAssignment() throws Exce

PrismContainer<?> extension = getAssignmentExtensionInstance();
PrismSchema piracySchema = getPiracySchema();
//noinspection unchecked
PrismPropertyDefinition<String> seaPropDef = piracySchema.findPropertyDefinitionByElementName(PIRACY_SEA_QNAME);
PrismProperty<String> seaProp = seaPropDef.instantiate();
seaProp.setRealValue("Caribbean");
Expand Down Expand Up @@ -734,6 +739,7 @@ public void test149JackUnAssignRoleBlackSeaPirateWithSeaInAssignment() throws Ex

PrismContainer<?> extension = getAssignmentExtensionInstance();
PrismSchema piracySchema = getPiracySchema();
//noinspection unchecked
PrismPropertyDefinition<String> seaPropDef = piracySchema.findPropertyDefinitionByElementName(PIRACY_SEA_QNAME);
PrismProperty<String> seaProp = seaPropDef.instantiate();
seaProp.setRealValue("Caribbean");
Expand Down Expand Up @@ -858,7 +864,7 @@ public void test169JackUnassignRolePirateComplicated() throws Exception {
testJackUnassignRolePirateRelationNoPrivs(RELATION_COMPLICATED_QNAME);
}

public void testJackAssignRolePirateRelationNoPrivs(QName relation) throws Exception {
private void testJackAssignRolePirateRelationNoPrivs(QName relation) throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();

Expand Down Expand Up @@ -899,7 +905,7 @@ private void assertJackAssignRolePirateRelationNoPrivs(QName relation) throws Ex
assertNoDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME);
}

public void testJackUnassignRolePirateRelationNoPrivs(QName relation) throws Exception {
private void testJackUnassignRolePirateRelationNoPrivs(QName relation) throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();

Expand Down Expand Up @@ -4083,13 +4089,12 @@ public void test820ModifyRoleImmutableGlobalAddExtension() throws Exception {
.getValue();
extensionContainerValue.createProperty(EXT_SEA)
.setRealValue("Caribbean");
traced( () ->
executeChanges(
prismContext.deltaFor(RoleType.class)
.item(RoleType.F_EXTENSION)
.add(extensionContainerValue.clone())
.asObjectDelta(ROLE_IMMUTABLE_SEA_GLOBAL.oid),
null, task, result));
null, task, result);

AssertJUnit.fail("Unexpected success");
} catch (PolicyViolationException e) {
Expand Down Expand Up @@ -4508,7 +4513,7 @@ public void test910UserFailingScript() throws Exception {
ObjectDelta<UserType> delta = prismContext.deltaFor(UserType.class)
.item(UserType.F_DESCRIPTION).replace("modified")
.asObjectDelta(USER_FAILING_SCRIPT.oid);
traced(() -> executeChanges(delta, null, task, result));
executeChanges(delta, null, task, result);

// THEN
then();
Expand All @@ -4530,7 +4535,7 @@ public void test920AddRecomputeTrigger() throws Exception {
task.setOwner(getUser(USER_ADMINISTRATOR_OID));
OperationResult result = task.getResult();

UserType user = new UserType(prismContext)
UserType user = new UserType()
.name("test920")
.beginAssignment()
.targetRef(ROLE_ADDING_RECOMPUTE_TRIGGER.oid, RoleType.COMPLEX_TYPE)
Expand Down Expand Up @@ -4561,7 +4566,7 @@ public void test930NonUnassignableRole() throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();

UserType user = new UserType(PrismContext.get())
UserType user = new UserType()
.name("test930")
.beginAssignment()
.targetRef(ROLE_NON_UNASSIGNABLE.oid, RoleType.COMPLEX_TYPE)
Expand Down

0 comments on commit 263828e

Please sign in to comment.