Browse Source

Merge pull request #5972 from izeye/test-20160514

* pr/5972:
  Fix Mockito tests to align with name and comments
pull/5980/head
Phillip Webb 10 years ago
parent
commit
682f20ebf7
  1. 3
      spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockBeanOnTestFieldForExistingBeanConfig.java
  2. 3
      spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockBeanOnTestFieldForNewBeanIntegrationTests.java
  3. 4
      spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.java
  4. 3
      spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanOnTestFieldForExistingBeanConfig.java
  5. 4
      spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanOnTestFieldForExistingBeanIntegrationTests.java
  6. 5
      spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanOnTestFieldForNewBeanIntegrationTests.java

3
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockBeanOnTestFieldForExistingBeanConfig.java

@ -17,6 +17,7 @@ @@ -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; @@ -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 {
}

3
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockBeanOnTestFieldForNewBeanIntegrationTests.java

@ -22,7 +22,6 @@ import org.junit.runner.RunWith; @@ -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 { @@ -51,7 +50,7 @@ public class MockBeanOnTestFieldForNewBeanIntegrationTests {
}
@Configuration
@Import({ ExampleServiceCaller.class, FailingExampleService.class })
@Import(ExampleServiceCaller.class)
static class Config {
}

4
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.java

@ -20,8 +20,8 @@ import org.junit.Test; @@ -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; @@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify;
public class SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests {
@SpyBean
private SimpleExampleService exampleService;
private ExampleService exampleService;
@Autowired
private ExampleServiceCaller caller;

3
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanOnTestFieldForExistingBeanConfig.java

@ -17,6 +17,7 @@ @@ -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; @@ -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 {
}

4
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanOnTestFieldForExistingBeanIntegrationTests.java

@ -20,8 +20,8 @@ import org.junit.Test; @@ -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; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.verify;
public class SpyBeanOnTestFieldForExistingBeanIntegrationTests {
@SpyBean
private SimpleExampleService exampleService;
private ExampleService exampleService;
@Autowired
private ExampleServiceCaller caller;

5
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanOnTestFieldForNewBeanIntegrationTests.java

@ -20,7 +20,6 @@ import org.junit.Test; @@ -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; @@ -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 { @@ -51,7 +50,7 @@ public class SpyBeanOnTestFieldForNewBeanIntegrationTests {
}
@Configuration
@Import({ ExampleServiceCaller.class, SimpleExampleService.class })
@Import(ExampleServiceCaller.class)
static class Config {
}

Loading…
Cancel
Save