Skip to content

Commit

Permalink
fixing GUI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Oct 28, 2021
1 parent 1753bc7 commit 093eced
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private List<ShadowWrapper> loadShadowWrappers() {
long timestampWrapperStart = System.currentTimeMillis();
try {

ShadowWrapper wrapper = loadShadowWrapper(projection, task, subResult);
ShadowWrapper wrapper = loadShadowWrapper(projection, true, task, subResult);
wrapper.setLoadWithNoFetch(true);
list.add(wrapper);

Expand All @@ -128,10 +128,10 @@ private Collection<SelectorOptions<GetOperationOptions>> createLoadOptionForShad
}

@NotNull
public ShadowWrapper loadShadowWrapper(PrismObject<ShadowType> projection, Task task, OperationResult result) throws SchemaException {
public ShadowWrapper loadShadowWrapper(PrismObject<ShadowType> projection, boolean noFetch, Task task, OperationResult result) throws SchemaException {
PrismObjectWrapperFactory<ShadowType> factory = getPageBase().findObjectWrapperFactory(projection.getDefinition());
WrapperContext context = new WrapperContext(task, result);
context.setCreateIfEmpty(false);
context.setCreateIfEmpty(noFetch ? false : true);
ShadowWrapper wrapper = (ShadowWrapper) factory.createObjectWrapper(projection, ItemStatus.NOT_CHANGED, context);
wrapper.setProjectionStatus(UserDtoStatus.MODIFY);
return wrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ private Collection<SelectorOptions<GetOperationOptions>> createLoadOptionForShad
public ShadowWrapper loadShadowWrapper(PrismObject<ShadowType> projection, Task task, OperationResult result) throws SchemaException {
PrismObjectWrapperFactory<ShadowType> factory = getPageBase().findObjectWrapperFactory(projection.getDefinition());
WrapperContext context = new WrapperContext(task, result);
context.setCreateIfEmpty(false);
context.setCreateIfEmpty(true);
context.setDetailsPageTypeConfiguration(findShadowDetailsPageConfiguration(projection.asObjectable()));
ShadowWrapper wrapper = (ShadowWrapper) factory.createObjectWrapper(projection, ItemStatus.NOT_CHANGED, context);
wrapper.setProjectionStatus(UserDtoStatus.MODIFY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public class TestIntegrationObjectWrapperFactory extends AbstractInitializedGuiI
UserType.F_CREDENTIALS,
UserType.F_ADMIN_GUI_CONFIGURATION,
UserType.F_BEHAVIOR,
UserType.F_LENS_CONTEXT, //experimental
UserType.F_POLICY_EXCEPTION); //experimental
private static final List<ItemPath> BASIC_SHADOW_CONTAINERS_PATHS = Arrays.asList(
ShadowType.F_EXTENSION,
Expand All @@ -96,7 +95,6 @@ public class TestIntegrationObjectWrapperFactory extends AbstractInitializedGuiI
ShadowType.F_ASSOCIATION,
ShadowType.F_ACTIVATION,
ShadowType.F_CREDENTIALS,
ShadowType.F_LENS_CONTEXT,
ShadowType.F_POLICY_EXCEPTION);
private static final List<ItemPath> BASIC_ORG_CONTAINERS_PATHS = Arrays.asList(
OrgType.F_EXTENSION,
Expand All @@ -111,7 +109,6 @@ public class TestIntegrationObjectWrapperFactory extends AbstractInitializedGuiI
OrgType.F_AUTOASSIGN,
OrgType.F_CREDENTIALS,
OrgType.F_BEHAVIOR,
ShadowType.F_LENS_CONTEXT,
ShadowType.F_POLICY_EXCEPTION);

@Override
Expand Down Expand Up @@ -419,6 +416,7 @@ public void test150CreateWrapperShadow() throws Exception {
PrismObjectWrapperFactory<ShadowType> factory = modelServiceLocator.findObjectWrapperFactory(shadow.getDefinition());
assertTrue("Wrong object factory found, expected shadow factory but got " + factory.getClass().getSimpleName(), factory instanceof ShadowWrapperFactoryImpl);
WrapperContext context = new WrapperContext(task, result);
context.setCreateIfEmpty(true);

PrismObjectWrapper<ShadowType> objectWrapper = factory.createObjectWrapper(shadow, ItemStatus.NOT_CHANGED, context);
assertTrue("Wrong wrapper created. Expected ShadowWrapper but got " + objectWrapper.getClass().getSimpleName(), objectWrapper instanceof ShadowWrapper);
Expand Down

0 comments on commit 093eced

Please sign in to comment.