Polish
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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">
|
||||
* @RunWith(SpringRunner.class)
|
||||
* public class ExampleTests {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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">
|
||||
* @RunWith(SpringRunner.class)
|
||||
* public class ExampleTests {
|
||||
|
||||
Reference in New Issue
Block a user