This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch log in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git
The following commit(s) were added to refs/heads/log by this push: new 4c62e8e Silence log messages in test 4c62e8e is described below commit 4c62e8ee3feadb5c2b1209ee3fb0991cf74ffeb7 Author: Elliotte Rusty Harold <elh...@ibiblio.org> AuthorDate: Sun Dec 8 07:39:30 2024 -0500 Silence log messages in test --- .../changes/jira/JqlQueryBuilderTestCase.java | 40 ++++++++++------------ 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/test/java/org/apache/maven/plugins/changes/jira/JqlQueryBuilderTestCase.java b/src/test/java/org/apache/maven/plugins/changes/jira/JqlQueryBuilderTestCase.java index 211ba79..73de832 100644 --- a/src/test/java/org/apache/maven/plugins/changes/jira/JqlQueryBuilderTestCase.java +++ b/src/test/java/org/apache/maven/plugins/changes/jira/JqlQueryBuilderTestCase.java @@ -34,8 +34,10 @@ import org.apache.maven.plugin.testing.SilentLog; public class JqlQueryBuilderTestCase extends TestCase { private static final String ENCODING = "UTF-8"; + private final JqlQueryBuilder builder = new JqlQueryBuilder(new SilentLog()); + public void testEmptyQuery() { - String actual = new JqlQueryBuilder(new SilentLog()).build(); + String actual = builder.build(); String expected = ""; assertEquals(expected, actual); } @@ -43,41 +45,41 @@ public class JqlQueryBuilderTestCase extends TestCase { public void testSingleParameterValue() throws UnsupportedEncodingException { String expected = URLEncoder.encode("project = DOXIA", ENCODING); - String actual = createBuilder().project("DOXIA").build(); + String actual = builder.project("DOXIA").build(); assertEquals(expected, actual); } public void testFixVersion() throws UnsupportedEncodingException { String expected = URLEncoder.encode("fixVersion = \"1.0\"", ENCODING); - String actual = createBuilder().fixVersion("1.0").build(); + String actual = builder.fixVersion("1.0").build(); assertEquals(expected, actual); } public void testFixVersionCombinedWithOtherParameters() throws UnsupportedEncodingException { String expected = URLEncoder.encode("project = DOXIA AND fixVersion = \"1.0\"", ENCODING); - String actual = createBuilder().project("DOXIA").fixVersion("1.0").build(); + String actual = builder.project("DOXIA").fixVersion("1.0").build(); assertEquals(expected, actual); } public void testSingleParameterSingleValue() throws UnsupportedEncodingException { String expected = URLEncoder.encode("priority in (Blocker)", ENCODING); - String actual = createBuilder().priorityIds("Blocker").build(); + String actual = builder.priorityIds("Blocker").build(); assertEquals(expected, actual); - actual = createBuilder().priorityIds(" Blocker ").build(); + actual = builder.priorityIds(" Blocker ").build(); assertEquals(expected, actual); } public void testSingleParameterMultipleValues() throws UnsupportedEncodingException { String expected = URLEncoder.encode("priority in (Blocker, Critical, Major)", ENCODING); - String actual = createBuilder().priorityIds("Blocker,Critical,Major").build(); + String actual = builder.priorityIds("Blocker,Critical,Major").build(); assertEquals(expected, actual); - actual = createBuilder().priorityIds(" Blocker , Critical, Major").build(); + actual = builder.priorityIds(" Blocker , Critical, Major").build(); assertEquals(expected, actual); } @@ -85,27 +87,27 @@ public class JqlQueryBuilderTestCase extends TestCase { String expected = URLEncoder.encode("priority in (Blocker) AND status in (Resolved)", ENCODING); String actual = - createBuilder().priorityIds("Blocker").statusIds("Resolved").build(); + builder.priorityIds("Blocker").statusIds("Resolved").build(); assertEquals(expected, actual); } public void testValueWithSpacesAreQuoted() throws UnsupportedEncodingException { String expected = URLEncoder.encode("status in (\"In Progress\")", ENCODING); - String actual = createBuilder().statusIds("In Progress").build(); + String actual = builder.statusIds("In Progress").build(); assertEquals(expected, actual); } public void testSortSingleRowAscending() throws UnsupportedEncodingException { String expected = URLEncoder.encode("project = DOXIA ORDER BY key ASC", ENCODING); - String actual = createBuilder().project("DOXIA").sortColumnNames("key").build(); + String actual = builder.project("DOXIA").sortColumnNames("key").build(); assertEquals(expected, actual); - actual = createBuilder().project("DOXIA").sortColumnNames("key ASC").build(); + actual = builder.project("DOXIA").sortColumnNames("key ASC").build(); assertEquals(expected, actual); - actual = createBuilder() + actual = builder .project("DOXIA") .sortColumnNames(" key ASC ") .build(); @@ -116,10 +118,10 @@ public class JqlQueryBuilderTestCase extends TestCase { String expected = URLEncoder.encode("project = DOXIA ORDER BY key DESC", ENCODING); String actual = - createBuilder().project("DOXIA").sortColumnNames("key DESC").build(); + builder.project("DOXIA").sortColumnNames("key DESC").build(); assertEquals(expected, actual); - actual = createBuilder() + actual = builder .project("DOXIA") .sortColumnNames(" key DESC ") .build(); @@ -129,7 +131,7 @@ public class JqlQueryBuilderTestCase extends TestCase { public void testSortMultipleColumns() throws UnsupportedEncodingException { String expected = URLEncoder.encode("project = DOXIA ORDER BY key ASC, assignee DESC, reporter ASC", ENCODING); - String actual = createBuilder() + String actual = builder .project("DOXIA") .sortColumnNames("key ASC,assignee DESC, reporter ASC") .build(); @@ -139,14 +141,10 @@ public class JqlQueryBuilderTestCase extends TestCase { public void testOrderByIsLastElement() throws UnsupportedEncodingException { String expected = URLEncoder.encode("project = DOXIA ORDER BY key ASC, assignee DESC, reporter ASC", ENCODING); - String actual = createBuilder() + String actual = builder .sortColumnNames("key ASC,assignee DESC, reporter ASC") .project("DOXIA") .build(); assertEquals(expected, actual); } - - private JqlQueryBuilder createBuilder() { - return new JqlQueryBuilder(new SystemStreamLog()); - } }