-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests for multiple archetypes support
- Loading branch information
Showing
17 changed files
with
499 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
293 changes: 22 additions & 271 deletions
293
model/model-common/src/main/java/com/evolveum/midpoint/model/common/ArchetypeManager.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
model/model-intest/src/test/resources/archetypes/archetype-auxiliary-manager.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!-- | ||
~ Copyright (c) 2021 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
<archetype oid="ab061953-44e0-496b-aca4-23c6caf0eb60" | ||
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" | ||
xmlns:org='http://midpoint.evolveum.com/xml/ns/public/common/org-3'> | ||
<name>Auxiliary Manager</name> | ||
<archetypeType>auxiliary</archetypeType> | ||
<archetypePolicy> | ||
<adminGuiConfiguration> | ||
<objectDetails> | ||
<type>c:UserType</type> | ||
<panel> | ||
<identifier>main</identifier> | ||
<path>.</path> | ||
<visibility>hidden</visibility> | ||
</panel> | ||
</objectDetails> | ||
</adminGuiConfiguration> | ||
</archetypePolicy> | ||
<inducement> | ||
<focusMappings> | ||
<mapping> | ||
<expression> | ||
<value>1234</value> | ||
</expression> | ||
<target> | ||
<path>costCenter</path> | ||
</target> | ||
</mapping> | ||
</focusMappings> | ||
</inducement> | ||
<assignment> | ||
<assignmentRelation> | ||
<holderType>UserType</holderType> | ||
</assignmentRelation> | ||
</assignment> | ||
</archetype> |
40 changes: 40 additions & 0 deletions
40
...rc/main/java/com/evolveum/midpoint/test/asserter/ContainerPanelConfigurationAsserter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2020 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.test.asserter; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserInterfaceElementVisibilityType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType; | ||
|
||
import org.assertj.core.api.Assertions; | ||
|
||
public class ContainerPanelConfigurationAsserter<RA> extends UserInterfaceFeatureAsserter<RA> { | ||
|
||
public ContainerPanelConfigurationAsserter(ContainerPanelConfigurationType panelConfiguration, RA returnAsserter, String details) { | ||
super(panelConfiguration, returnAsserter, details); | ||
} | ||
|
||
public ContainerPanelConfigurationAsserter<RA> identifier(String identifier) { | ||
super.identifier(identifier); | ||
return this; | ||
} | ||
|
||
public ContainerPanelConfigurationAsserter<RA> visibility(UserInterfaceElementVisibilityType visibility) { | ||
super.visibility(visibility); | ||
return this; | ||
} | ||
|
||
public ContainerPanelConfigurationAsserter<RA> assertDisplayOrder(int order) { | ||
super.assertDisplayOrder(order); | ||
return this; | ||
} | ||
|
||
@Override | ||
protected String desc() { | ||
return "virtual containers"; | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
.../src/main/java/com/evolveum/midpoint/test/asserter/ContainerPanelConfigurationFinder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2020 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.test.asserter; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType; | ||
|
||
import org.assertj.core.api.Assertions; | ||
|
||
import java.util.List; | ||
import java.util.function.Predicate; | ||
import java.util.stream.Collectors; | ||
|
||
public class ContainerPanelConfigurationFinder<RA> extends UserInterfaceFeatureFinder<ContainerPanelConfigurationAsserter<ContainerPanelConfigurationsAsserter<RA>>, ContainerPanelConfigurationType> { | ||
|
||
private ContainerPanelConfigurationsAsserter<RA> containerPanelConfigurationsAsserter; | ||
|
||
public ContainerPanelConfigurationFinder(ContainerPanelConfigurationsAsserter<RA> containerPanelConfigurationsAsserter) { | ||
this.containerPanelConfigurationsAsserter = containerPanelConfigurationsAsserter; | ||
} | ||
|
||
@Override | ||
public ContainerPanelConfigurationFinder<RA> identifier(String identifier) { | ||
super.identifier(identifier); | ||
return this; | ||
} | ||
|
||
@Override | ||
public ContainerPanelConfigurationFinder<RA> displayName(String displayName) { | ||
super.displayName(displayName); | ||
return this; | ||
} | ||
|
||
@Override | ||
public ContainerPanelConfigurationAsserter<ContainerPanelConfigurationsAsserter<RA>> find() { | ||
return super.find(); | ||
} | ||
|
||
@Override | ||
protected ContainerPanelConfigurationAsserter<ContainerPanelConfigurationsAsserter<RA>> find(Predicate<ContainerPanelConfigurationType> filter) { | ||
List<ContainerPanelConfigurationType> foundVirtualContainers = containerPanelConfigurationsAsserter.getPanels() | ||
.stream() | ||
.filter(filter) | ||
.collect(Collectors.toList()); | ||
Assertions.assertThat(foundVirtualContainers).hasSize(1); | ||
return new ContainerPanelConfigurationAsserter<>(foundVirtualContainers.iterator().next(), containerPanelConfigurationsAsserter, "from list of virtual containers " + containerPanelConfigurationsAsserter.getPanels()); | ||
} | ||
|
||
} |
Oops, something went wrong.