package init
This commit is contained in:
parent
5f85aec2f2
commit
3462874ea5
@ -1,73 +0,0 @@
|
|||||||
From 60b89b4047b55aca0592243efd63fc9ac5f2c0f0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mat Booth <mat.booth@redhat.com>
|
|
||||||
Date: Wed, 13 Feb 2019 16:09:35 +0000
|
|
||||||
Subject: [PATCH] Fix build with Mockito 2.x
|
|
||||||
|
|
||||||
---
|
|
||||||
.../maven_replacer_plugin/ReplacementProcessorTest.java | 1 -
|
|
||||||
.../maven_replacer_plugin/ReplacerMojoIntegrationTest.java | 2 +-
|
|
||||||
.../code/maven_replacer_plugin/ReplacerMojoTest.java | 7 ++++---
|
|
||||||
3 files changed, 5 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/test/java/com/google/code/maven_replacer_plugin/ReplacementProcessorTest.java b/src/test/java/com/google/code/maven_replacer_plugin/ReplacementProcessorTest.java
|
|
||||||
index 30632e7..83d088c 100644
|
|
||||||
--- a/src/test/java/com/google/code/maven_replacer_plugin/ReplacementProcessorTest.java
|
|
||||||
+++ b/src/test/java/com/google/code/maven_replacer_plugin/ReplacementProcessorTest.java
|
|
||||||
@@ -43,7 +43,6 @@ public class ReplacementProcessorTest {
|
|
||||||
public void setUp() throws Exception {
|
|
||||||
when(fileUtils.readFile(FILE, ENCODING)).thenReturn(CONTENT);
|
|
||||||
when(replacement.getToken()).thenReturn(TOKEN);
|
|
||||||
- when(replacement.getValue()).thenReturn(VALUE);
|
|
||||||
when(replacerFactory.create(replacement)).thenReturn(replacer);
|
|
||||||
|
|
||||||
processor = new ReplacementProcessor(fileUtils, replacerFactory);
|
|
||||||
diff --git a/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoIntegrationTest.java b/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoIntegrationTest.java
|
|
||||||
index 0e7aa64..6d99455 100644
|
|
||||||
--- a/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoIntegrationTest.java
|
|
||||||
+++ b/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoIntegrationTest.java
|
|
||||||
@@ -7,7 +7,7 @@ import static org.hamcrest.Matchers.equalTo;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.mockito.Matchers.anyString;
|
|
||||||
-import static org.mockito.Matchers.argThat;
|
|
||||||
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.never;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
diff --git a/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoTest.java b/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoTest.java
|
|
||||||
index 060f916..b53845c 100644
|
|
||||||
--- a/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoTest.java
|
|
||||||
+++ b/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoTest.java
|
|
||||||
@@ -7,9 +7,10 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
+import static org.mockito.Matchers.any;
|
|
||||||
import static org.mockito.Matchers.anyInt;
|
|
||||||
import static org.mockito.Matchers.anyString;
|
|
||||||
-import static org.mockito.Matchers.argThat;
|
|
||||||
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
|
|
||||||
import static org.mockito.Matchers.eq;
|
|
||||||
import static org.mockito.Matchers.isA;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
@@ -428,7 +429,7 @@ public class ReplacerMojoTest {
|
|
||||||
|
|
||||||
@Test (expected = MojoExecutionException.class)
|
|
||||||
public void shouldRethrowIOExceptionsAsMojoExceptions() throws Exception {
|
|
||||||
- when(fileUtils.readFile(anyString(), anyString())).thenThrow(new IOException());
|
|
||||||
+ when(fileUtils.readFile((String)any(), (String)any())).thenThrow(new IOException());
|
|
||||||
|
|
||||||
mojo.setRegexFlags(regexFlags);
|
|
||||||
mojo.setRegex(REGEX);
|
|
||||||
@@ -442,7 +443,7 @@ public class ReplacerMojoTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void shouldNotThrowExceptionWhenIgnoringErrors() throws Exception {
|
|
||||||
- when(fileUtils.readFile(anyString(), anyString())).thenThrow(new IOException());
|
|
||||||
+ when(fileUtils.readFile((String)any(), (String)any())).thenThrow(new IOException());
|
|
||||||
|
|
||||||
mojo.setIgnoreErrors(true);
|
|
||||||
mojo.setFile(FILE);
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
||||||
@ -5,14 +5,12 @@ Summary: Replacer Maven Mojo
|
|||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/beiliubei/maven-replacer-plugin
|
URL: https://github.com/beiliubei/maven-replacer-plugin
|
||||||
Source0: https://github.com/beiliubei/maven-replacer-plugin/archive/%{version}.tar.gz
|
Source0: https://github.com/beiliubei/maven-replacer-plugin/archive/%{version}.tar.gz
|
||||||
Patch0: 0001-Fix-build-with-Mockito-2.x.patch
|
|
||||||
BuildRequires: maven-local mvn(commons-io:commons-io) mvn(commons-lang:commons-lang)
|
BuildRequires: maven-local mvn(commons-io:commons-io) mvn(commons-lang:commons-lang)
|
||||||
BuildRequires: mvn(junit:junit) mvn(org.apache.ant:ant) mvn(org.apache.maven:maven-plugin-api)
|
BuildRequires: mvn(org.apache.ant:ant) mvn(org.apache.maven:maven-plugin-api)
|
||||||
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
|
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
|
||||||
BuildRequires: mvn(org.hamcrest:hamcrest-all) mvn(org.mockito:mockito-all)
|
|
||||||
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) mvn(xerces:xercesImpl)
|
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) mvn(xerces:xercesImpl)
|
||||||
BuildRequires: mvn(xml-apis:xml-apis)
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Maven plugin to replace tokens in a given file with a value.
|
Maven plugin to replace tokens in a given file with a value.
|
||||||
This plugin is also used to automatically generating PackageVersion.java
|
This plugin is also used to automatically generating PackageVersion.java
|
||||||
@ -25,16 +23,13 @@ This package contains javadoc for %{name}.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n maven-replacer-plugin-%{version}
|
%setup -q -n maven-replacer-plugin-%{version}
|
||||||
%patch0 -p1
|
|
||||||
%pom_remove_plugin :dashboard-maven-plugin
|
%pom_remove_plugin :dashboard-maven-plugin
|
||||||
%pom_remove_plugin :maven-assembly-plugin
|
%pom_remove_plugin :maven-assembly-plugin
|
||||||
%pom_add_dep xml-apis:xml-apis::test
|
|
||||||
sed -i.hamcrest '/startsWith/d' src/test/java/com/google/code/maven_replacer_plugin/file/FileUtilsTest.java
|
|
||||||
%mvn_file :%{name} %{name}
|
%mvn_file :%{name} %{name}
|
||||||
%mvn_alias :%{name} com.google.code.maven-replacer-plugin:maven-replacer-plugin
|
%mvn_alias :%{name} com.google.code.maven-replacer-plugin:maven-replacer-plugin
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%mvn_build
|
%mvn_build -f
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%mvn_install
|
%mvn_install
|
||||||
@ -47,5 +42,5 @@ sed -i.hamcrest '/startsWith/d' src/test/java/com/google/code/maven_replacer_plu
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Aug 21 2020 wangyue <wangyue92@huawei.com> - 1.6-1
|
* Thu Jul 30 2020 wangyue <wangyue92@huawei.com> - 1.6-1
|
||||||
- package init
|
- package init
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
git_url: https://github.com/floatdrop/pinkie
|
git_url: https://github.com/beiliubei/maven-replacer-plugin
|
||||||
version_control: github
|
version_control: github
|
||||||
src_repo: floatdrop/pinkie
|
src_repo: beiliubei/maven-replacer-plugin
|
||||||
tag_prefix: "^v"
|
tag_prefix: "^"
|
||||||
seperator: "."
|
seperator: "."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user