|
|
|
@ -1,12 +1,13 @@
|
|
|
|
|
%bcond_with bootstrap
|
|
|
|
|
|
|
|
|
|
Name: mockito
|
|
|
|
|
Version: 3.7.13
|
|
|
|
|
Release: 5%{?dist}
|
|
|
|
|
Version: 3.12.4
|
|
|
|
|
Release: 6%{?dist}
|
|
|
|
|
Summary: Tasty mocking framework for unit tests in Java
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://site.mockito.org/
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
ExclusiveArch: %{java_arches} noarch
|
|
|
|
|
|
|
|
|
|
# ./generate-tarball.sh
|
|
|
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
@ -15,20 +16,27 @@ Source1: generate-tarball.sh
|
|
|
|
|
# A custom build script to allow building with maven instead of gradle
|
|
|
|
|
Source2: mockito-core.pom
|
|
|
|
|
|
|
|
|
|
# Maven central POMs for subprojects
|
|
|
|
|
Source3: https://repo1.maven.org/maven2/org/mockito/mockito-inline/%{version}/mockito-inline-%{version}.pom
|
|
|
|
|
Source4: https://repo1.maven.org/maven2/org/mockito/mockito-junit-jupiter/%{version}/mockito-junit-jupiter-%{version}.pom
|
|
|
|
|
|
|
|
|
|
# Mockito expects byte-buddy to have a shaded/bundled version of ASM, but
|
|
|
|
|
# we don't bundle in Fedora, so this patch makes mockito use ASM explicitly
|
|
|
|
|
Patch0: use-unbundled-asm.patch
|
|
|
|
|
|
|
|
|
|
BuildRequires: maven-local
|
|
|
|
|
%if %{with bootstrap}
|
|
|
|
|
BuildRequires: javapackages-bootstrap
|
|
|
|
|
%else
|
|
|
|
|
BuildRequires: maven-local
|
|
|
|
|
BuildRequires: mvn(biz.aQute.bnd:biz.aQute.bnd)
|
|
|
|
|
BuildRequires: mvn(junit:junit)
|
|
|
|
|
BuildRequires: mvn(net.bytebuddy:byte-buddy)
|
|
|
|
|
BuildRequires: mvn(net.bytebuddy:byte-buddy-agent)
|
|
|
|
|
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
|
|
|
|
BuildRequires: mvn(org.apiguardian:apiguardian-api)
|
|
|
|
|
BuildRequires: mvn(org.assertj:assertj-core)
|
|
|
|
|
BuildRequires: mvn(org.hamcrest:hamcrest)
|
|
|
|
|
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api)
|
|
|
|
|
BuildRequires: mvn(org.objenesis:objenesis)
|
|
|
|
|
BuildRequires: mvn(org.opentest4j:opentest4j)
|
|
|
|
|
BuildRequires: mvn(org.ow2.asm:asm)
|
|
|
|
@ -46,9 +54,25 @@ Summary: Javadocs for %{name}
|
|
|
|
|
%description javadoc
|
|
|
|
|
This package contains the API documentation for %{name}.
|
|
|
|
|
|
|
|
|
|
%package inline
|
|
|
|
|
Summary: Mockito preconfigured inline mock maker
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description inline
|
|
|
|
|
Mockito preconfigured inline mock maker (intermediate and to be
|
|
|
|
|
superseded by automatic usage in a future version).
|
|
|
|
|
|
|
|
|
|
%if %{without bootstrap}
|
|
|
|
|
%package junit-jupiter
|
|
|
|
|
Summary: Mockito JUnit 5 support
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description junit-jupiter
|
|
|
|
|
Mockito JUnit 5 support.
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q
|
|
|
|
|
%patch0 -p1
|
|
|
|
|
%autosetup -p1
|
|
|
|
|
|
|
|
|
|
# Disable failing test
|
|
|
|
|
# TODO check status: https://github.com/mockito/mockito/issues/2162
|
|
|
|
@ -57,7 +81,12 @@ sed -i '/add_listeners_concurrently_sanity_check/i @org.junit.Ignore' src/test/j
|
|
|
|
|
# Use our custom build script
|
|
|
|
|
sed -e 's/@VERSION@/%{version}/' %{SOURCE2} > pom.xml
|
|
|
|
|
|
|
|
|
|
# OGGi metadata configuration
|
|
|
|
|
# Workaround easymock incompatibility with Java 17 that should be fixed
|
|
|
|
|
# in easymock 4.4: https://github.com/easymock/easymock/issues/274
|
|
|
|
|
%pom_add_plugin :maven-surefire-plugin . "<configuration>
|
|
|
|
|
<argLine>--add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED</argLine></configuration>"
|
|
|
|
|
|
|
|
|
|
# OSGi metadata configuration
|
|
|
|
|
cat > osgi.bnd <<EOF
|
|
|
|
|
Automatic-Module-Name: org.mockito
|
|
|
|
|
Bundle-SymbolicName: org.mockito
|
|
|
|
@ -67,18 +96,50 @@ Private-Package: org.mockito.*
|
|
|
|
|
-removeheaders: Bnd-LastModified,Include-Resource,Private-Package
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
# OSGi metadata configuration for the junit-jupiter jar
|
|
|
|
|
cat > osgi-junit-jupiter.bnd <<EOF
|
|
|
|
|
Automatic-Module-Name: org.mockito.junit.jupiter
|
|
|
|
|
Bundle-SymbolicName: org.mockito.junit-jupiter
|
|
|
|
|
Bundle-Name: Mockito Extension Library for JUnit 5.
|
|
|
|
|
Import-Package: org.junit.jupiter.api.extension;version="[5.7,6)",org.junit.platform.commons.support;version="[1.7,2)",org.mockito*;version="%{version}",*
|
|
|
|
|
-removeheaders: Bnd-LastModified,Include-Resource
|
|
|
|
|
Export-Package: org.mockito.junit.jupiter;version="%{version}";uses:="org.junit.jupiter.api.extension,org.mockito.quality"
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
# Compatibility alias
|
|
|
|
|
%mvn_alias org.%{name}:%{name}-core org.%{name}:%{name}-all
|
|
|
|
|
|
|
|
|
|
sed -i 's/net\.bytebuddy\.jar\.asm/org.objectweb.asm/' src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodAdvice.java
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
# See the usage of exec-maven-plugin in the pom
|
|
|
|
|
mkdir -p target/classes/
|
|
|
|
|
javac -d target/classes/ src/main/java/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.java
|
|
|
|
|
javac --release 8 -d target/classes/ src/main/java/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.java
|
|
|
|
|
mv target/classes/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.{class,raw}
|
|
|
|
|
|
|
|
|
|
%mvn_build -- -Dproject.build.sourceEncoding=UTF-8
|
|
|
|
|
%mvn_build -f -- -Dproject.build.sourceEncoding=UTF-8
|
|
|
|
|
|
|
|
|
|
# Build the inline subproject
|
|
|
|
|
cd subprojects/inline/src/main/resources
|
|
|
|
|
jar cf ../../../../../target/mockito-inline.jar mockito-extensions
|
|
|
|
|
cd -
|
|
|
|
|
%mvn_artifact %{SOURCE3} target/mockito-inline.jar
|
|
|
|
|
%mvn_package org.mockito:mockito-inline inline
|
|
|
|
|
|
|
|
|
|
%if %{without bootstrap}
|
|
|
|
|
# Build the junit-jupiter subproject
|
|
|
|
|
cd subprojects/junit-jupiter
|
|
|
|
|
mkdir -p target/classes/
|
|
|
|
|
CLASSPATH=$(build-classpath apiguardian junit5/junit-jupiter-api junit5/junit-platform-commons)
|
|
|
|
|
javac --release 8 -d target/classes/ \
|
|
|
|
|
-cp ../../target/mockito-core-%{version}.jar:$CLASSPATH \
|
|
|
|
|
src/main/java/org/mockito/junit/jupiter/*.java
|
|
|
|
|
jar -cf ../../target/mockito-junit-jupiter.unwrapped.jar -C target/classes org
|
|
|
|
|
cd -
|
|
|
|
|
bnd wrap --properties osgi-junit-jupiter.bnd --version %{version} \
|
|
|
|
|
--output target/mockito-junit-jupiter.jar \
|
|
|
|
|
target/mockito-junit-jupiter.unwrapped.jar
|
|
|
|
|
%mvn_artifact %{SOURCE4} target/mockito-junit-jupiter.jar
|
|
|
|
|
%mvn_package org.mockito:mockito-junit-jupiter junit-jupiter
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%mvn_install
|
|
|
|
@ -87,19 +148,44 @@ mv target/classes/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispa
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%doc README.md doc/design-docs/custom-argument-matching.md
|
|
|
|
|
|
|
|
|
|
%files inline -f .mfiles-inline
|
|
|
|
|
|
|
|
|
|
%if %{without bootstrap}
|
|
|
|
|
%files junit-jupiter -f .mfiles-junit-jupiter
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files javadoc -f .mfiles-javadoc
|
|
|
|
|
%license LICENSE
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.7.13-5
|
|
|
|
|
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
|
|
|
|
Related: rhbz#1991688
|
|
|
|
|
* Mon Feb 05 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.12.4-6
|
|
|
|
|
- Rebuild to regenerate auto-requires
|
|
|
|
|
|
|
|
|
|
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.4-5
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Sat Apr 09 2022 Didik Supriadi <didiksupriadi41@fedoraproject.org> - 3.12.4-4
|
|
|
|
|
- Set javac compiler release to Java 8
|
|
|
|
|
|
|
|
|
|
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 3.12.4-3
|
|
|
|
|
- Rebuilt for java-17-openjdk as system jdk
|
|
|
|
|
|
|
|
|
|
* Thu Jan 27 2022 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.12.4-2
|
|
|
|
|
- Don't build mockito-junit-jupiter in bootstrap mode
|
|
|
|
|
|
|
|
|
|
* Sat Jan 22 2022 Jerry James <loganjerry@gmail.com> - 3.12.4-1
|
|
|
|
|
- Version 3.12.4
|
|
|
|
|
- Add inline and junit-jupiter subpackages
|
|
|
|
|
- Drop OpenJDK 17 workarounds
|
|
|
|
|
|
|
|
|
|
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.13-5
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Wed Jun 09 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.7.13-4
|
|
|
|
|
- Rebuild to workaround DistroBaker issue
|
|
|
|
|
* Wed Nov 03 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.7.13-4
|
|
|
|
|
- Workaround build issue with OpenJDK 17
|
|
|
|
|
|
|
|
|
|
* Tue Jun 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.7.13-3
|
|
|
|
|
- Bootstrap Maven for CentOS Stream 9
|
|
|
|
|
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.13-3
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.7.13-2
|
|
|
|
|
- Bootstrap build
|
|
|
|
|