Fix Mockito tests to align with name and comments

Fixup Mockto tests where the test implementation didn't align with the
name of the test or the test Javadoc.

Closes gh-5972
This commit is contained in:
Johnny Lim 2016-05-14 13:20:19 +09:00 committed by Phillip Webb
parent 2fc86b2d5a
commit 5759f685e5
6 changed files with 11 additions and 11 deletions

View File

@ -17,6 +17,7 @@
package org.springframework.boot.test.mock.mockito; package org.springframework.boot.test.mock.mockito;
import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller; import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller;
import org.springframework.boot.test.mock.mockito.example.FailingExampleService;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
@ -28,7 +29,7 @@ import org.springframework.context.annotation.Import;
* @author Phillip Webb * @author Phillip Webb
*/ */
@Configuration @Configuration
@Import(ExampleServiceCaller.class) @Import({ ExampleServiceCaller.class, FailingExampleService.class })
public class MockBeanOnTestFieldForExistingBeanConfig { public class MockBeanOnTestFieldForExistingBeanConfig {
} }

View File

@ -22,7 +22,6 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.example.ExampleService; import org.springframework.boot.test.mock.mockito.example.ExampleService;
import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller; import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller;
import org.springframework.boot.test.mock.mockito.example.FailingExampleService;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
@ -51,7 +50,7 @@ public class MockBeanOnTestFieldForNewBeanIntegrationTests {
} }
@Configuration @Configuration
@Import({ ExampleServiceCaller.class, FailingExampleService.class }) @Import(ExampleServiceCaller.class)
static class Config { static class Config {
} }

View File

@ -20,8 +20,8 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.example.ExampleService;
import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller; import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller;
import org.springframework.boot.test.mock.mockito.example.SimpleExampleService;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify;
public class SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests { public class SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests {
@SpyBean @SpyBean
private SimpleExampleService exampleService; private ExampleService exampleService;
@Autowired @Autowired
private ExampleServiceCaller caller; private ExampleServiceCaller caller;

View File

@ -17,6 +17,7 @@
package org.springframework.boot.test.mock.mockito; package org.springframework.boot.test.mock.mockito;
import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller; import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller;
import org.springframework.boot.test.mock.mockito.example.SimpleExampleService;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
@ -28,7 +29,7 @@ import org.springframework.context.annotation.Import;
* @author Phillip Webb * @author Phillip Webb
*/ */
@Configuration @Configuration
@Import(ExampleServiceCaller.class) @Import({ ExampleServiceCaller.class, SimpleExampleService.class })
public class SpyBeanOnTestFieldForExistingBeanConfig { public class SpyBeanOnTestFieldForExistingBeanConfig {
} }

View File

@ -20,8 +20,8 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.example.ExampleService;
import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller; import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller;
import org.springframework.boot.test.mock.mockito.example.SimpleExampleService;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
@ -39,7 +39,7 @@ import static org.mockito.Mockito.verify;
public class SpyBeanOnTestFieldForExistingBeanIntegrationTests { public class SpyBeanOnTestFieldForExistingBeanIntegrationTests {
@SpyBean @SpyBean
private SimpleExampleService exampleService; private ExampleService exampleService;
@Autowired @Autowired
private ExampleServiceCaller caller; private ExampleServiceCaller caller;

View File

@ -20,7 +20,6 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.example.ExampleService;
import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller; import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller;
import org.springframework.boot.test.mock.mockito.example.SimpleExampleService; import org.springframework.boot.test.mock.mockito.example.SimpleExampleService;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -39,7 +38,7 @@ import static org.mockito.Mockito.verify;
public class SpyBeanOnTestFieldForNewBeanIntegrationTests { public class SpyBeanOnTestFieldForNewBeanIntegrationTests {
@SpyBean @SpyBean
private ExampleService exampleService; private SimpleExampleService exampleService;
@Autowired @Autowired
private ExampleServiceCaller caller; private ExampleServiceCaller caller;
@ -51,7 +50,7 @@ public class SpyBeanOnTestFieldForNewBeanIntegrationTests {
} }
@Configuration @Configuration
@Import({ ExampleServiceCaller.class, SimpleExampleService.class }) @Import(ExampleServiceCaller.class)
static class Config { static class Config {
} }