JAVA-13336 Refactor mockito modules (#12517)

* JAVA-13336 Refactor mockito modules

* JAVA-13336 Fix Jenkins build
This commit is contained in:
anuragkumawat 2022-07-21 23:10:50 +05:30 committed by GitHub
parent baeaf4335f
commit b23fcdc4c4
44 changed files with 24 additions and 141 deletions

View File

@ -1,14 +0,0 @@
*.class
.settings
.project
#folders#
/target
/src/main/webapp/WEB-INF/classes
*/META-INF/*
# Packaged files #
*.jar
*.war
*.ear

View File

@ -1,10 +0,0 @@
### Relevant articles
- [Mockitos Java 8 Features](https://www.baeldung.com/mockito-2-java-8)
- [Lazy Verification with Mockito 2](https://www.baeldung.com/mockito-2-lazy-verification)
- [Mockito Strict Stubbing and The UnnecessaryStubbingException](https://www.baeldung.com/mockito-unnecessary-stubbing-exception)
- [Mockito and Fluent APIs](https://www.baeldung.com/mockito-fluent-apis)
- [Mocking the ObjectMapper readValue() Method](https://www.baeldung.com/mockito-mock-jackson-read-value)
- [Introduction to Mockitos AdditionalAnswers](https://www.baeldung.com/mockito-additionalanswers)
- [Difference Between when() and doXxx() Methods in Mockito](https://www.baeldung.com/java-mockito-when-vs-do)
- [Overview of Mockito MockSettings](https://www.baeldung.com/mockito-mocksettings)

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>mockito-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>mockito-2</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>testing-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>

View File

@ -1,13 +1,14 @@
*.class
.settings
.project
#folders#
/target
/neoDb*
/data
/src/main/webapp/WEB-INF/classes
*/META-INF/*
# Packaged files #
*.jar
*.war
*.ear
*.ear

View File

@ -1,8 +1,12 @@
=========
### Relevant articles
## Mockito Cookbooks and Examples
### Relevant Articles:
- [Mockitos Java 8 Features](https://www.baeldung.com/mockito-2-java-8)
- [Lazy Verification with Mockito 2](https://www.baeldung.com/mockito-2-lazy-verification)
- [Mockito Strict Stubbing and The UnnecessaryStubbingException](https://www.baeldung.com/mockito-unnecessary-stubbing-exception)
- [Mockito and Fluent APIs](https://www.baeldung.com/mockito-fluent-apis)
- [Mocking the ObjectMapper readValue() Method](https://www.baeldung.com/mockito-mock-jackson-read-value)
- [Introduction to Mockitos AdditionalAnswers](https://www.baeldung.com/mockito-additionalanswers)
- [Difference Between when() and doXxx() Methods in Mockito](https://www.baeldung.com/java-mockito-when-vs-do)
- [Overview of Mockito MockSettings](https://www.baeldung.com/mockito-mocksettings)
- [Testing Callbacks with Mockito](https://www.baeldung.com/mockito-callbacks)
- [Quick Guide to BDDMockito](https://www.baeldung.com/bdd-mockito)

View File

@ -4,75 +4,28 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>mockito</artifactId>
<version>0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT</version>
<name>mockito</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-java</relativePath>
<artifactId>testing-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring-framework.version}</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring-data.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>${javax.persistence.version}</version>
</dependency>
<!-- utils -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<!-- test scoped -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>mockito</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<properties>
<spring-boot.version>2.0.4.RELEASE</spring-boot.version>
<spring-framework.version>5.0.8.RELEASE</spring-framework.version>
<spring-data.version>2.0.9.RELEASE</spring-data.version>
<!-- testing -->
<powermock.version>2.0.2</powermock.version>
<javax.persistence.version>2.1.1</javax.persistence.version>
</properties>
</project>

View File

@ -2,17 +2,11 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>web - %date [%thread] %-5level %logger{36} - %message%n
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<logger name="org.springframework" level="WARN" />
<logger name="org.springframework.transaction" level="WARN" />
<!-- in order to debug some marshalling issues, this needs to be TRACE -->
<logger name="org.springframework.web.servlet.mvc" level="WARN" />
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>

View File

@ -29,7 +29,6 @@
<module>junit5-annotations</module>
<module>junit5-migration</module>
<module>load-testing-comparison</module>
<module>mockito-2</module>
<module>mockito</module>
<module>mockito-simple</module>
<module>mocks</module>