Skip to content

Commit

Permalink
MID-8842 ninja - attempt to fix ninja tests
Browse files Browse the repository at this point in the history
(cherry picked from commit eacc999)
  • Loading branch information
1azyman committed Jul 31, 2023
1 parent a500e14 commit 81ee183
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class NinjaContext implements Closeable {
private static final String REPOSITORY_SERVICE_BEAN = "repositoryService";
private static final String AUDIT_SERVICE_BEAN = "auditService";

private static final String CTX_NINJA = "classpath:ctx-ninja.xml";
private static final String CTX_NINJA = "classpath*:ctx-ninja.xml";

public final PrintStream out;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void test100ImportByOid() throws Exception {

executeTest(
out -> Assertions.assertThat(out.size()).isEqualTo(5),
err -> Assertions.assertThat(err.size()).isZero(),
EMPTY_STREAM_VALIDATOR,
"-m", getMidpointHome(), "import", "--oid", "00000000-8888-6666-0000-100000000001", "-i", PATH_MONKEY_ISLAND_SIMPLE_ZIP, "-z");

then();
Expand All @@ -76,7 +76,7 @@ public void test110ImportByFilterAsOption() throws Exception {

executeTest(
out -> Assertions.assertThat(out.size()).isEqualTo(5),
err -> Assertions.assertThat(err.size()).isZero(),
EMPTY_STREAM_VALIDATOR,
"-m", getMidpointHome(), "import", "-f", "<equal><path>name</path><value>F0002</value></equal>",
"-i", PATH_MONKEY_ISLAND_SIMPLE_ZIP, "-z");

Expand All @@ -99,7 +99,7 @@ public void test120ImportByFilterAsFile() throws Exception {

executeTest(
out -> Assertions.assertThat(out.size()).isEqualTo(5),
err -> Assertions.assertThat(err.size()).isZero(),
EMPTY_STREAM_VALIDATOR,
"-m", getMidpointHome(), "import", "-f", "@src/test/resources/filter.xml",
"-i", PATH_MONKEY_ISLAND_SIMPLE_ZIP, "-z", "-O");

Expand Down
21 changes: 21 additions & 0 deletions tools/ninja/src/test/resources/ctx-ninja.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2010-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.
-->
<!--
This context is just used in tests to inject test beans into ninja context initialized before
action is executed (internally by ninja).
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
default-lazy-init="false">

<bean id="dummyAuditServiceFactory" class="com.evolveum.midpoint.test.DummyAuditServiceFactory"/>

</beans>

0 comments on commit 81ee183

Please sign in to comment.