2019-02-12 08:05:09 +00:00
|
|
|
#
|
|
|
|
# spec file for package mockito
|
|
|
|
#
|
2024-02-21 21:47:01 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-02-12 08:05:09 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: mockito
|
2024-04-19 07:46:55 +00:00
|
|
|
Version: 5.11.0
|
2019-02-12 08:05:09 +00:00
|
|
|
Release: 0
|
2024-04-19 11:12:34 +00:00
|
|
|
Summary: A Java mocking framework
|
2019-02-12 08:05:09 +00:00
|
|
|
License: MIT
|
2024-04-19 11:12:34 +00:00
|
|
|
Group: Development/Libraries/Java
|
|
|
|
URL: http://%{name}.org
|
2019-02-12 08:05:09 +00:00
|
|
|
Source0: %{name}-%{version}.tar.xz
|
2024-04-19 05:20:53 +00:00
|
|
|
# build with maven instead of gradle
|
|
|
|
Source2: aggregator.pom
|
|
|
|
Source3: https://repo1.maven.org/maven2/org/mockito/mockito-core/%{version}/mockito-core-%{version}.pom
|
|
|
|
Source4: https://repo1.maven.org/maven2/org/mockito/mockito-junit-jupiter/%{version}/mockito-junit-jupiter-%{version}.pom
|
|
|
|
Patch0: use-unbundled-asm.patch
|
|
|
|
Patch1: keep-source-target-8.patch
|
2019-02-12 08:05:09 +00:00
|
|
|
BuildRequires: fdupes
|
2024-04-19 05:20:53 +00:00
|
|
|
BuildRequires: maven-local
|
|
|
|
BuildRequires: mvn(junit:junit)
|
|
|
|
BuildRequires: mvn(net.bytebuddy:byte-buddy)
|
|
|
|
BuildRequires: mvn(net.bytebuddy:byte-buddy-agent)
|
|
|
|
BuildRequires: mvn(net.bytebuddy:byte-buddy-dep)
|
2024-04-22 05:25:23 +00:00
|
|
|
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
2024-04-19 05:20:53 +00:00
|
|
|
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
|
|
|
|
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api)
|
|
|
|
BuildRequires: mvn(org.objenesis:objenesis)
|
|
|
|
BuildRequires: mvn(org.opentest4j:opentest4j)
|
2019-02-12 08:05:09 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description
|
2024-04-19 11:12:34 +00:00
|
|
|
Mockito is a mocking framework. It lets you write tests. Tests
|
|
|
|
produce clean verification errors.
|
2024-04-19 05:20:53 +00:00
|
|
|
|
|
|
|
%package junit-jupiter
|
|
|
|
Summary: Mockito JUnit 5 support
|
2024-04-19 11:12:34 +00:00
|
|
|
Group: Development/Libraries/Java
|
2024-04-19 05:20:53 +00:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description junit-jupiter
|
|
|
|
Mockito JUnit 5 support.
|
2019-02-12 08:05:09 +00:00
|
|
|
|
|
|
|
%package javadoc
|
|
|
|
Summary: Javadocs for %{name}
|
2024-04-19 11:12:34 +00:00
|
|
|
Group: Documentation/HTML
|
2019-02-12 08:05:09 +00:00
|
|
|
|
|
|
|
%description javadoc
|
|
|
|
This package contains the API documentation for %{name}.
|
|
|
|
|
|
|
|
%prep
|
2024-04-19 05:20:53 +00:00
|
|
|
%autosetup -p1
|
|
|
|
|
|
|
|
cp %{SOURCE2} aggregator.pom
|
|
|
|
cp %{SOURCE3} pom.xml
|
|
|
|
cp %{SOURCE4} subprojects/junit-jupiter/pom.xml
|
|
|
|
|
|
|
|
# Compatibility alias
|
|
|
|
%{mvn_alias} org.%{name}:%{name}-core org.%{name}:%{name}-all
|
|
|
|
|
|
|
|
%pom_add_dep junit:junit
|
|
|
|
%pom_add_dep net.bytebuddy:byte-buddy-dep
|
|
|
|
%pom_remove_dep org.objenesis:objenesis
|
|
|
|
%pom_add_dep org.objenesis:objenesis
|
|
|
|
%pom_add_dep org.opentest4j:opentest4j
|
|
|
|
|
|
|
|
%pom_remove_dep org.junit.jupiter:junit-jupiter-api subprojects/junit-jupiter
|
|
|
|
%pom_add_dep org.junit.jupiter:junit-jupiter-api subprojects/junit-jupiter
|
|
|
|
|
|
|
|
mkdir -p src/main/resources/mockito-extensions
|
|
|
|
echo 'member-accessor-module' > src/main/resources/mockito-extensions/org.mockito.plugins.MemberAccessor
|
|
|
|
echo 'mock-maker-subclass' > src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker
|
|
|
|
|
|
|
|
# see gradle/mockito-core/inline-mock.gradle
|
|
|
|
%pom_xpath_inject 'pom:project' '
|
|
|
|
<build>
|
2024-04-19 06:57:19 +00:00
|
|
|
<plugins>
|
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
|
|
<version>any</version>
|
|
|
|
<executions>
|
|
|
|
<execution>
|
|
|
|
<phase>process-classes</phase>
|
|
|
|
<configuration>
|
|
|
|
<target>
|
|
|
|
<copy file="${project.build.outputDirectory}/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.class"
|
|
|
|
tofile="${project.build.outputDirectory}/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.raw"/>
|
|
|
|
</target>
|
|
|
|
</configuration>
|
|
|
|
<goals>
|
|
|
|
<goal>run</goal>
|
|
|
|
</goals>
|
|
|
|
</execution>
|
|
|
|
</executions>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
|
|
<version>any</version>
|
2024-04-19 05:20:53 +00:00
|
|
|
<configuration>
|
2024-04-19 06:57:19 +00:00
|
|
|
<excludes>
|
|
|
|
<exclude>org/mockito/internal/creation/bytebuddy/inject/*.class</exclude>
|
|
|
|
</excludes>
|
2024-04-19 05:20:53 +00:00
|
|
|
</configuration>
|
2024-04-19 06:57:19 +00:00
|
|
|
</plugin>
|
|
|
|
</plugins>
|
2024-04-19 05:20:53 +00:00
|
|
|
</build>
|
|
|
|
'
|
|
|
|
|
2024-04-22 05:25:23 +00:00
|
|
|
%pom_xpath_inject "pom:project" "<packaging>bundle</packaging>"
|
|
|
|
%pom_add_plugin org.apache.felix:maven-bundle-plugin:2.3.7 . '
|
|
|
|
<extensions>true</extensions>
|
|
|
|
<configuration>
|
|
|
|
<instructions>
|
|
|
|
<Bundle-Name>Mockito Mock Library for Java.</Bundle-Name>
|
|
|
|
<Bundle-SymbolicName>org.mockito.mockito-core</Bundle-SymbolicName>
|
|
|
|
<Import-Package>net.bytebuddy.*,junit.*;resolution:=optional,org.junit.*;resolution:=optional,org.hamcrest;resolution:=optional,org.objenesis,org.mockito.*</Import-Package>
|
|
|
|
<Export-Package>org.mockito.internal.*;status=INTERNAL;mandatory:=status,org.mockito.*</Export-Package>
|
|
|
|
<Private-Package>org.mockito.*</Private-Package>
|
|
|
|
<_removeheaders>Private-Package</_removeheaders>
|
|
|
|
<Automatic-Module-Name>org.mockito</Automatic-Module-Name>
|
|
|
|
<_noextraheaders>true</_noextraheaders>
|
|
|
|
</instructions>
|
|
|
|
</configuration>
|
|
|
|
<executions>
|
|
|
|
<execution>
|
|
|
|
<id>bundle-manifest</id>
|
|
|
|
<phase>process-classes</phase>
|
|
|
|
<goals>
|
|
|
|
<goal>manifest</goal>
|
|
|
|
</goals>
|
|
|
|
</execution>
|
|
|
|
</executions>'
|
|
|
|
|
2024-04-19 05:20:53 +00:00
|
|
|
%{mvn_package} :aggregator __noinstall
|
2019-02-12 08:05:09 +00:00
|
|
|
|
|
|
|
%build
|
2024-04-19 05:20:53 +00:00
|
|
|
%{mvn_build} -f -- \
|
|
|
|
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \
|
2024-04-19 11:12:34 +00:00
|
|
|
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 9}%{!?pkg_vcmp:0}
|
|
|
|
-Dmaven.compiler.release=8 \
|
|
|
|
%endif
|
2024-04-19 05:20:53 +00:00
|
|
|
-Dmaven.compiler.source=8 -Dmaven.compiler.target=8 -Dsource=8 \
|
|
|
|
-Dproject.build.sourceEncoding=UTF-8 -f aggregator.pom
|
2023-09-13 05:05:04 +00:00
|
|
|
|
2024-04-19 05:20:53 +00:00
|
|
|
%{mvn_package} org.mockito:mockito-junit-jupiter junit-jupiter
|
2019-02-12 08:05:09 +00:00
|
|
|
|
|
|
|
%install
|
2024-04-19 05:20:53 +00:00
|
|
|
%mvn_install
|
2019-02-12 08:05:09 +00:00
|
|
|
%fdupes -s %{buildroot}%{_javadocdir}
|
|
|
|
|
|
|
|
%files -f .mfiles
|
2024-04-19 05:20:53 +00:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.md doc/design-docs/custom-argument-matching.md
|
|
|
|
|
|
|
|
%files junit-jupiter -f .mfiles-junit-jupiter
|
2019-02-12 08:05:09 +00:00
|
|
|
|
2024-04-19 05:20:53 +00:00
|
|
|
%files javadoc -f .mfiles-javadoc
|
|
|
|
%license LICENSE
|
2019-02-12 08:05:09 +00:00
|
|
|
|
|
|
|
%changelog
|