From 225cf6d2f4453f171bfb1d43dc772441b017a8d6 Mon Sep 17 00:00:00 2001 From: priyeshmashelkar Date: Fri, 20 Jul 2018 10:45:03 +0100 Subject: [PATCH 1/2] BAEL-1907 Created new module spring-testing --- testing-modules/spring-testing/README.md | 2 + testing-modules/spring-testing/pom.xml | 75 +++++++++++++++++++ .../org/baeldung/mockito/repository/User.java | 0 .../mockito/repository/UserRepository.java | 0 .../mockito/MockAnnotationUnitTest.java | 0 .../MockBeanAnnotationIntegrationTest.java | 2 +- 6 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 testing-modules/spring-testing/README.md create mode 100644 testing-modules/spring-testing/pom.xml rename testing-modules/{mockito => spring-testing}/src/main/java/org/baeldung/mockito/repository/User.java (100%) rename testing-modules/{mockito => spring-testing}/src/main/java/org/baeldung/mockito/repository/UserRepository.java (100%) rename testing-modules/{mockito => spring-testing}/src/test/java/org/baeldung/mockito/MockAnnotationUnitTest.java (100%) rename testing-modules/{mockito => spring-testing}/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java (90%) diff --git a/testing-modules/spring-testing/README.md b/testing-modules/spring-testing/README.md new file mode 100644 index 0000000000..a96ddccabb --- /dev/null +++ b/testing-modules/spring-testing/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: + diff --git a/testing-modules/spring-testing/pom.xml b/testing-modules/spring-testing/pom.xml new file mode 100644 index 0000000000..be05373822 --- /dev/null +++ b/testing-modules/spring-testing/pom.xml @@ -0,0 +1,75 @@ + + 4.0.0 + org.baeldung + spring-testing + 0.1-SNAPSHOT + spring-testing + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + + org.hamcrest + java-hamcrest + ${hamcrest.version} + + + + org.springframework.boot + spring-boot-starter + LATEST + test + + + org.springframework.boot + spring-boot-starter-test + LATEST + test + + + org.springframework + spring-core + LATEST + + + org.springframework + spring-context + LATEST + + + org.eclipse.persistence + javax.persistence + 2.1.1 + + + org.springframework.data + spring-data-jpa + LATEST + + + + + spring-testing + + + src/main/resources + true + + + + + + + + 2.0.0.0 + + + \ No newline at end of file diff --git a/testing-modules/mockito/src/main/java/org/baeldung/mockito/repository/User.java b/testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/User.java similarity index 100% rename from testing-modules/mockito/src/main/java/org/baeldung/mockito/repository/User.java rename to testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/User.java diff --git a/testing-modules/mockito/src/main/java/org/baeldung/mockito/repository/UserRepository.java b/testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/UserRepository.java similarity index 100% rename from testing-modules/mockito/src/main/java/org/baeldung/mockito/repository/UserRepository.java rename to testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/UserRepository.java diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockAnnotationUnitTest.java b/testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockAnnotationUnitTest.java similarity index 100% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockAnnotationUnitTest.java rename to testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockAnnotationUnitTest.java diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java b/testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java similarity index 90% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java rename to testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java index fd9236fe13..3a7e58fb48 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java +++ b/testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java @@ -20,7 +20,7 @@ public class MockBeanAnnotationIntegrationTest { ApplicationContext context; @Test - public void givenCountMethodMocked_WhenCountInvokedOnBeanFromContext_ThenMockValueReturned() { + public void givenCountMethodMocked_WhenCountInvoked_ThenMockValueReturned() { Mockito.when(mockRepository.count()).thenReturn(123L); UserRepository userRepoFromContext = context.getBean(UserRepository.class); From 76a4a86ab26f2c2dc12a9553a0eb118585bd5f8c Mon Sep 17 00:00:00 2001 From: priyeshmashelkar Date: Fri, 20 Jul 2018 11:57:31 +0100 Subject: [PATCH 2/2] BAEL-1907 Corrected formatting --- testing-modules/spring-testing/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing-modules/spring-testing/pom.xml b/testing-modules/spring-testing/pom.xml index be05373822..a137bc8d33 100644 --- a/testing-modules/spring-testing/pom.xml +++ b/testing-modules/spring-testing/pom.xml @@ -9,8 +9,8 @@ com.baeldung parent-java - 0.0.1-SNAPSHOT - ../../parent-java + 0.0.1-SNAPSHOT + ../../parent-java