Skip to content

Commit

Permalink
Merge pull request #64 from mmnaseri/release-v1.1#60
Browse files Browse the repository at this point in the history
Release v1.1
  • Loading branch information
mmnaseri committed Jun 9, 2016
2 parents 185af08 + 09784d7 commit 4d85d71
Show file tree
Hide file tree
Showing 43 changed files with 1,716 additions and 584 deletions.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Donae](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://paypal.me/mmnaseri)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.mmnaseri.utils/spring-data-mock/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.mmnaseri.utils/spring-data-mock)
[![Dependency Status](https://www.versioneye.com/user/projects/5709ee7dfcd19a00415b101a/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5709ee7dfcd19a00415b101a)
[![Dependency Status](https://www.versioneye.com/user/projects/5722a8f5ba37ce0031fc17f0/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5722a8f5ba37ce0031fc17f0)
[![Build Status](https://travis-ci.org/mmnaseri/spring-data-mock.svg?branch=master)](https://travis-ci.org/mmnaseri/spring-data-mock)
[![Codacy Badge](https://api.codacy.com/project/badge/grade/ad9f174fa0654a2b8c925b86973f272d)](https://www.codacy.com/app/mmnaseri/spring-data-mock)
[![Coverage Status](https://coveralls.io/repos/github/mmnaseri/spring-data-mock/badge.svg?branch=master)](https://coveralls.io/github/mmnaseri/spring-data-mock?branch=master)
Expand Down Expand Up @@ -39,8 +39,30 @@ or you can add a maven dependency since it is now available in Maven central:
<groupId>com.mmnaseri.utils</groupId>
<artifactId>spring-data-mock</artifactId>
<version>${latest-version}</version>
<scope>test</scope>
</dependency>

#### Note on Dependencies

*Spring Data Mock* depends on [Apache Commons Logging](https://commons.apache.org/proper/commons-logging/) to log
all the interactions with the framework. If you need to, you can exclude this dependency from the framework by
using [Maven exclusions](https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html#Dependency_Exclusions):

```xml
<dependency>
<groupId>com.mmnaseri.utils</groupId>
<artifactId>spring-data-mock</artifactId>
<version>${latest-version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
```

## Quick Start

Regardless of how you add the necessary dependency to your project, mocking a repository can be as simple as:
Expand All @@ -49,6 +71,20 @@ Regardless of how you add the necessary dependency to your project, mocking a re

where `builder()` is a static method of the `RepositoryFactoryBuilder` class under package `com.mmnaseri.utils.spring.data.dsl.factory`.

Example:

```java
import com.mmnaseri.utils.spring.data.dsl.factory.RepositoryFactoryBuilder;

public class CustomerRepositoryTest {

@Test
public void testDemo() {

final CustomerRepository repository = RepositoryFactoryBuilder.builder().mock(CustomerRepository.class);
repository.save(new Customer());
```

An alternate way of mocking a repository would be by using the `RepositoryMockBuilder` class under the `com.mmnaseri.utils.spring.data.dsl.mock`
package:

Expand Down
2 changes: 1 addition & 1 deletion spring-data-mock-build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<groupId>com.mmnaseri.utils</groupId>
<artifactId>spring-data-mock-build</artifactId>
<version>1.0.2</version>
<version>1.1</version>
<name>Spring Data Mock: Build Aggregator</name>
<description>This is the build module that will aggregate all reactors for the spring-data-mock project</description>
<url>https://mmnaseri.github.io/spring-data-mock</url>
Expand Down
44 changes: 41 additions & 3 deletions spring-data-mock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<groupId>com.mmnaseri.utils</groupId>
<artifactId>spring-data-mock</artifactId>
<version>1.0.3</version>
<version>1.1</version>
<name>Spring Data Mock</name>
<description>A framework for mocking Spring Data repositories</description>
<url>https://mmnaseri.github.io/spring-data-mock</url>
Expand Down Expand Up @@ -80,6 +80,34 @@
</build>

<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-collections</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>${cglib.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
Expand Down Expand Up @@ -125,6 +153,13 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda-time.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>${persistence-api.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down Expand Up @@ -270,16 +305,19 @@
<spring-data-commons.version>1.12.1.RELEASE</spring-data-commons.version>
<spring-data-gemfire.version>1.8.1.RELEASE</spring-data-gemfire.version>
<spring-data-jpa.version>1.10.1.RELEASE</spring-data-jpa.version>
<jackson-databind.version>2.7.3</jackson-databind.version>
<jackson-databind.version>2.7.4</jackson-databind.version>
<testng.version>6.9.10</testng.version>
<hamcrest.version>1.3</hamcrest.version>
<joda-time.version>2.9.3</joda-time.version>
<joda-time.version>2.9.4</joda-time.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
<maven-source-plugin.version>3.0.0</maven-source-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
<cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
<querydsl.version>4.1.0</querydsl.version>
<cglib.version>3.2.2</cglib.version>
<persistence-api.version>1.0.2</persistence-api.version>
</properties>

</project>
Loading

0 comments on commit 4d85d71

Please sign in to comment.