This commit is contained in:
Phillip Webb
2016-09-16 18:33:06 -07:00
parent 6ec1ac0aa0
commit 04448d6bd9
10 changed files with 21 additions and 24 deletions

View File

@@ -38,7 +38,8 @@ abstract class Definition {
private final boolean proxyTargetAware;
Definition(AnnotatedElement element, String name, MockReset reset, boolean proxyTargetAware) {
Definition(AnnotatedElement element, String name, MockReset reset,
boolean proxyTargetAware) {
this.element = element;
this.name = name;
this.reset = (reset != null ? reset : MockReset.AFTER);

View File

@@ -92,7 +92,7 @@ class DefinitionsParser {
}
for (ResolvableType typeToMock : typesToMock) {
MockDefinition definition = new MockDefinition(element, annotation.name(),
typeToMock, annotation.extraInterfaces(), annotation.answer(),
typeToMock, annotation.extraInterfaces(), annotation.answer(),
annotation.serializable(), annotation.reset());
addDefinition(definition, "mock");
}
@@ -113,8 +113,7 @@ class DefinitionsParser {
}
}
private void addDefinition(Definition definition,
String type) {
private void addDefinition(Definition definition, String type) {
boolean isNewDefinition = this.definitions.add(definition);
Assert.state(isNewDefinition, "Duplicate " + type + " definition " + definition);
AnnotatedElement element = definition.getElement();

View File

@@ -66,8 +66,7 @@ import org.springframework.test.context.junit4.SpringRunner;
*
*
* }
* </pre>
* If there is more than one bean of the requested type, qualifier metadata must be
* </pre> If there is more than one bean of the requested type, qualifier metadata must be
* specified at field level: <pre class="code">
* &#064;RunWith(SpringRunner.class)
* public class ExampleTests {

View File

@@ -50,8 +50,9 @@ class MockDefinition extends Definition {
private final boolean serializable;
MockDefinition(AnnotatedElement element, String name, ResolvableType typeToMock, Class<?>[] extraInterfaces,
Answers answer, boolean serializable, MockReset reset) {
MockDefinition(AnnotatedElement element, String name, ResolvableType typeToMock,
Class<?>[] extraInterfaces, Answers answer, boolean serializable,
MockReset reset) {
super(element, name, reset, false);
Assert.notNull(typeToMock, "TypeToMock must not be null");
this.typeToMock = typeToMock;

View File

@@ -66,8 +66,7 @@ import org.springframework.test.context.junit4.SpringRunner;
*
*
* }
* </pre>
* If there is more than one bean of the requested type, qualifier metadata must be
* </pre> If there is more than one bean of the requested type, qualifier metadata must be
* specified at field level: <pre class="code">
* &#064;RunWith(SpringRunner.class)
* public class ExampleTests {