Skip to content

Commit

Permalink
Make tests in notification-impl work
Browse files Browse the repository at this point in the history
For some strange reasons, beans in task-quartz-impl were not initialized
correctly when running tests in notification-impl. At least in some
environments. This small change in Spring contexts seems to fix that.
  • Loading branch information
mederly committed Mar 2, 2021
1 parent d9f4c70 commit 1d21843
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 29 deletions.
Expand Up @@ -46,20 +46,7 @@
/**
*
*/
@ContextConfiguration(locations = {"classpath:ctx-task.xml",
"classpath:ctx-repo-cache.xml",
"classpath:ctx-provisioning.xml",
"classpath*:ctx-repository-test.xml",
"classpath:ctx-configuration-test.xml",
"classpath:ctx-common.xml",
"classpath:ctx-repo-common.xml",
"classpath:ctx-security.xml",
"classpath:ctx-security-enforcer.xml",
"classpath:ctx-audit.xml",
"classpath:ctx-model.xml",
"classpath:ctx-model-common.xml",
"classpath:ctx-notifications-test.xml",
"classpath*:ctx-notifications.xml"})
@ContextConfiguration(locations = {"classpath:ctx-notifications-test.xml"})
public class TestTextFormatter extends AbstractSpringTest {

private static final String OBJECTS_DIR_NAME = "src/test/resources/objects";
Expand Down
Expand Up @@ -34,20 +34,7 @@
/**
* @author skublik
*/
@ContextConfiguration(locations = { "classpath:ctx-task.xml",
"classpath:ctx-repo-cache.xml",
"classpath:ctx-provisioning.xml",
"classpath*:ctx-repository-test.xml",
"classpath:ctx-configuration-test.xml",
"classpath:ctx-common.xml",
"classpath:ctx-repo-common.xml",
"classpath:ctx-security.xml",
"classpath:ctx-security-enforcer.xml",
"classpath:ctx-audit.xml",
"classpath:ctx-model.xml",
"classpath:ctx-model-common.xml",
"classpath:ctx-notifications-test.xml",
"classpath*:ctx-notifications.xml" })
@ContextConfiguration(locations = {"classpath:ctx-notifications-test.xml"})
public class TestTransportUtils extends AbstractSpringTest {

@Autowired protected ExpressionFactory expressionFactory;
Expand Down
Expand Up @@ -15,4 +15,20 @@

<context:annotation-config/>
<context:component-scan base-package="com.evolveum.midpoint.notifications.impl"/>
<context:spring-configured/>

<import resource="ctx-model.xml"/>
<import resource="ctx-model-common.xml"/>
<import resource="classpath*:ctx-repository-test.xml"/>
<import resource="ctx-repo-cache.xml"/>
<import resource="ctx-configuration-test.xml"/>
<import resource="ctx-provisioning.xml"/>
<import resource="ctx-repo-common.xml"/>
<import resource="ctx-common.xml"/>
<import resource="ctx-security.xml"/>
<import resource="ctx-security-enforcer.xml"/>
<import resource="ctx-task.xml"/>
<import resource="ctx-audit.xml"/>
<import resource="ctx-security.xml"/>
<import resource="ctx-notifications.xml"/>
</beans>
Expand Up @@ -99,7 +99,6 @@ public boolean isCurrentNode(String node) {
return nodeRegistrar.isCurrentNode(node);
}


public void deleteNode(String nodeOid, OperationResult result) throws SchemaException, ObjectNotFoundException {
nodeRegistrar.deleteNode(nodeOid, result);
}
Expand Down

0 comments on commit 1d21843

Please sign in to comment.