Commit 682f20eb authored by Phillip Webb's avatar Phillip Webb

Merge pull request #5972 from izeye/test-20160514

* pr/5972:
  Fix Mockito tests to align with name and comments
parents 2fc86b2d 5759f685
......@@ -17,6 +17,7 @@
package org.springframework.boot.test.mock.mockito;
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.Import;
......@@ -28,7 +29,7 @@ import org.springframework.context.annotation.Import;
* @author Phillip Webb
*/
@Configuration
@Import(ExampleServiceCaller.class)
@Import({ ExampleServiceCaller.class, FailingExampleService.class })
public class MockBeanOnTestFieldForExistingBeanConfig {
}
......@@ -22,7 +22,6 @@ import org.junit.runner.RunWith;
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.FailingExampleService;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;
......@@ -51,7 +50,7 @@ public class MockBeanOnTestFieldForNewBeanIntegrationTests {
}
@Configuration
@Import({ ExampleServiceCaller.class, FailingExampleService.class })
@Import(ExampleServiceCaller.class)
static class Config {
}
......
......@@ -20,8 +20,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
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.SimpleExampleService;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
......@@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify;
public class SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests {
@SpyBean
private SimpleExampleService exampleService;
private ExampleService exampleService;
@Autowired
private ExampleServiceCaller caller;
......
......@@ -17,6 +17,7 @@
package org.springframework.boot.test.mock.mockito;
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.Import;
......@@ -28,7 +29,7 @@ import org.springframework.context.annotation.Import;
* @author Phillip Webb
*/
@Configuration
@Import(ExampleServiceCaller.class)
@Import({ ExampleServiceCaller.class, SimpleExampleService.class })
public class SpyBeanOnTestFieldForExistingBeanConfig {
}
......@@ -20,8 +20,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
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.SimpleExampleService;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
......@@ -39,7 +39,7 @@ import static org.mockito.Mockito.verify;
public class SpyBeanOnTestFieldForExistingBeanIntegrationTests {
@SpyBean
private SimpleExampleService exampleService;
private ExampleService exampleService;
@Autowired
private ExampleServiceCaller caller;
......
......@@ -20,7 +20,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
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.SimpleExampleService;
import org.springframework.context.annotation.Configuration;
......@@ -39,7 +38,7 @@ import static org.mockito.Mockito.verify;
public class SpyBeanOnTestFieldForNewBeanIntegrationTests {
@SpyBean
private ExampleService exampleService;
private SimpleExampleService exampleService;
@Autowired
private ExampleServiceCaller caller;
......@@ -51,7 +50,7 @@ public class SpyBeanOnTestFieldForNewBeanIntegrationTests {
}
@Configuration
@Import({ ExampleServiceCaller.class, SimpleExampleService.class })
@Import(ExampleServiceCaller.class)
static class Config {
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment