mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Polishing
This commit is contained in:
+74
-72
@@ -108,8 +108,8 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
assertThat(o).isEqualTo("");
|
||||
assertThat(testClass.list).hasSize(4);
|
||||
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(() ->
|
||||
parser.parseExpression("list2[3]").getValue(new StandardEvaluationContext(testClass)));
|
||||
assertThatExceptionOfType(EvaluationException.class)
|
||||
.isThrownBy(() -> parser.parseExpression("list2[3]").getValue(new StandardEvaluationContext(testClass)));
|
||||
|
||||
o = parser.parseExpression("foo[3]").getValue(new StandardEvaluationContext(testClass));
|
||||
assertThat(o).isEqualTo("");
|
||||
@@ -127,8 +127,8 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
o = parser.parseExpression("map").getValue(ctx);
|
||||
assertThat(o).isNotNull();
|
||||
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
parser.parseExpression("map2['a']").getValue(ctx));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> parser.parseExpression("map2['a']").getValue(ctx));
|
||||
// map2 should be null, there is no setter
|
||||
}
|
||||
|
||||
@@ -144,8 +144,8 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
o = parser.parseExpression("wibble").getValue(ctx);
|
||||
assertThat(o).isNotNull();
|
||||
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
parser.parseExpression("wibble2.bar").getValue(ctx));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> parser.parseExpression("wibble2.bar").getValue(ctx));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -270,8 +270,8 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
@Test
|
||||
void resolvingList() {
|
||||
StandardEvaluationContext context = TestScenarioCreator.getTestEvaluationContext();
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(() ->
|
||||
parser.parseExpression("T(List)!=null").getValue(context, Boolean.class));
|
||||
assertThatExceptionOfType(EvaluationException.class)
|
||||
.isThrownBy(() -> parser.parseExpression("T(List)!=null").getValue(context, Boolean.class));
|
||||
((StandardTypeLocator) context.getTypeLocator()).registerImport("java.util");
|
||||
assertThat(parser.parseExpression("T(List)!=null").getValue(context, Boolean.class)).isTrue();
|
||||
}
|
||||
@@ -343,8 +343,8 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
// Register a custom MethodFilter...
|
||||
MethodFilter methodFilter = methods -> null;
|
||||
assertThatIllegalStateException()
|
||||
.isThrownBy(() -> context.registerMethodFilter(String.class, methodFilter))
|
||||
.withMessage("Method filter cannot be set as the reflective method resolver is not in use");
|
||||
.isThrownBy(() -> context.registerMethodFilter(String.class, methodFilter))
|
||||
.withMessage("Method filter cannot be set as the reflective method resolver is not in use");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -380,9 +380,9 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
StandardEvaluationContext failCtx = new StandardEvaluationContext(instance);
|
||||
parser = new SpelExpressionParser(new SpelParserConfiguration(false, false));
|
||||
Expression failExp = parser.parseExpression("listOfStrings[3]");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
failExp.getValue(failCtx, String.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.COLLECTION_INDEX_OUT_OF_BOUNDS));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> failExp.getValue(failCtx, String.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.COLLECTION_INDEX_OUT_OF_BOUNDS));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -567,12 +567,12 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
void rogueTrailingDotCausesNPE_SPR6866() {
|
||||
assertThatExceptionOfType(SpelParseException.class).isThrownBy(() ->
|
||||
new SpelExpressionParser().parseExpression("placeOfBirth.foo."))
|
||||
.satisfies(ex -> {
|
||||
assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OOD);
|
||||
assertThat(ex.getPosition()).isEqualTo(16);
|
||||
});
|
||||
assertThatExceptionOfType(SpelParseException.class)
|
||||
.isThrownBy(() -> new SpelExpressionParser().parseExpression("placeOfBirth.foo."))
|
||||
.satisfies(ex -> {
|
||||
assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OOD);
|
||||
assertThat(ex.getPosition()).isEqualTo(16);
|
||||
});
|
||||
}
|
||||
|
||||
@Nested
|
||||
@@ -591,12 +591,12 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
void propertiesNested03() throws ParseException {
|
||||
assertThatExceptionOfType(SpelParseException.class).isThrownBy(() ->
|
||||
new SpelExpressionParser().parseRaw("placeOfBirth.23"))
|
||||
.satisfies(ex -> {
|
||||
assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.UNEXPECTED_DATA_AFTER_DOT);
|
||||
assertThat(ex.getInserts()[0]).isEqualTo("23");
|
||||
});
|
||||
assertThatExceptionOfType(SpelParseException.class)
|
||||
.isThrownBy(() -> new SpelExpressionParser().parseRaw("placeOfBirth.23"))
|
||||
.satisfies(ex -> {
|
||||
assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.UNEXPECTED_DATA_AFTER_DOT);
|
||||
assertThat(ex.getInserts()[0]).isEqualTo("23");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -680,26 +680,26 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
void andWithNullValueOnLeft() {
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(
|
||||
parser.parseExpression("null and true")::getValue);
|
||||
assertThatExceptionOfType(EvaluationException.class)
|
||||
.isThrownBy(parser.parseExpression("null and true")::getValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
void andWithNullValueOnRight() {
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(
|
||||
parser.parseExpression("true and null")::getValue);
|
||||
assertThatExceptionOfType(EvaluationException.class)
|
||||
.isThrownBy(parser.parseExpression("true and null")::getValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
void orWithNullValueOnLeft() {
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(
|
||||
parser.parseExpression("null or false")::getValue);
|
||||
assertThatExceptionOfType(EvaluationException.class)
|
||||
.isThrownBy(parser.parseExpression("null or false")::getValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
void orWithNullValueOnRight() {
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(
|
||||
parser.parseExpression("false or null")::getValue);
|
||||
assertThatExceptionOfType(EvaluationException.class)
|
||||
.isThrownBy(parser.parseExpression("false or null")::getValue);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -757,8 +757,8 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
void ternaryOperatorWithNullValue() {
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(
|
||||
parser.parseExpression("null ? 0 : 1")::getValue);
|
||||
assertThatExceptionOfType(EvaluationException.class)
|
||||
.isThrownBy(parser.parseExpression("null ? 0 : 1")::getValue);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -859,9 +859,9 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
|
||||
Expression e = parser.parseExpression("#this++");
|
||||
assertThat(i).isEqualTo(42);
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e.getValue(ctx, Integer.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e.getValue(ctx, Integer.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -977,14 +977,14 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
|
||||
|
||||
Expression e1 = parser.parseExpression("m()++");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e1.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OPERAND_NOT_INCREMENTABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e1.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OPERAND_NOT_INCREMENTABLE));
|
||||
|
||||
Expression e2 = parser.parseExpression("++m()");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e2.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OPERAND_NOT_INCREMENTABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e2.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OPERAND_NOT_INCREMENTABLE));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -993,13 +993,13 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext(i);
|
||||
ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
|
||||
Expression e1 = parser.parseExpression("++1");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e1.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e1.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
Expression e2 = parser.parseExpression("1++");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e2.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e2.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1009,9 +1009,9 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
|
||||
Expression e = parser.parseExpression("#this--");
|
||||
assertThat(i).isEqualTo(42);
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e.getValue(ctx, Integer.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e.getValue(ctx, Integer.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1127,14 +1127,14 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
|
||||
|
||||
Expression e1 = parser.parseExpression("m()--");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e1.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OPERAND_NOT_DECREMENTABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e1.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OPERAND_NOT_DECREMENTABLE));
|
||||
|
||||
Expression e2 = parser.parseExpression("--m()");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e2.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OPERAND_NOT_DECREMENTABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e2.getValue(ctx, Double.TYPE))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.OPERAND_NOT_DECREMENTABLE));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1143,14 +1143,14 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext(i);
|
||||
ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
|
||||
Expression e1 = parser.parseExpression("--1");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e1.getValue(ctx, Integer.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e1.getValue(ctx, Integer.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
|
||||
Expression e2 = parser.parseExpression("1--");
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
e2.getValue(ctx, Integer.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> e2.getValue(ctx, Integer.class))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.NOT_ASSIGNABLE));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1508,13 +1508,15 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
private void expectFail(ExpressionParser parser, EvaluationContext eContext, String expressionString, SpelMessage messageCode) {
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() -> {
|
||||
Expression e = parser.parseExpression(expressionString);
|
||||
if (DEBUG) {
|
||||
SpelUtilities.printAbstractSyntaxTree(System.out, e);
|
||||
}
|
||||
e.getValue(eContext);
|
||||
}).satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(messageCode));
|
||||
assertThatExceptionOfType(SpelEvaluationException.class)
|
||||
.isThrownBy(() -> {
|
||||
Expression e = parser.parseExpression(expressionString);
|
||||
if (DEBUG) {
|
||||
SpelUtilities.printAbstractSyntaxTree(System.out, e);
|
||||
}
|
||||
e.getValue(eContext);
|
||||
})
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(messageCode));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-14
@@ -25,11 +25,8 @@ import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
||||
import org.springframework.expression.EvaluationContext;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.expression.ExpressionInvocationTargetException;
|
||||
import org.springframework.expression.MethodExecutor;
|
||||
import org.springframework.expression.MethodFilter;
|
||||
import org.springframework.expression.MethodResolver;
|
||||
import org.springframework.expression.spel.standard.SpelExpression;
|
||||
@@ -221,7 +218,10 @@ class MethodInvocationTests extends AbstractExpressionTests {
|
||||
List<MethodResolver> methodResolvers = ctx.getMethodResolvers();
|
||||
assertThat(methodResolvers).hasSize(1);
|
||||
|
||||
MethodResolver dummy = new DummyMethodResolver();
|
||||
MethodResolver dummy = (context, targetObject, name, argumentTypes) -> {
|
||||
throw new UnsupportedOperationException();
|
||||
};
|
||||
|
||||
ctx.addMethodResolver(dummy);
|
||||
assertThat(ctx.getMethodResolvers()).hasSize(2);
|
||||
|
||||
@@ -389,16 +389,6 @@ class MethodInvocationTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
|
||||
static class DummyMethodResolver implements MethodResolver {
|
||||
|
||||
@Override
|
||||
public MethodExecutor resolve(EvaluationContext context, Object targetObject, String name,
|
||||
List<TypeDescriptor> argumentTypes) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class BytesService {
|
||||
|
||||
public byte[] handleBytes(byte[] bytes) {
|
||||
|
||||
+3
-8
@@ -63,6 +63,7 @@ import org.springframework.expression.spel.support.StandardTypeLocator;
|
||||
import org.springframework.expression.spel.testresources.le.div.mod.reserved.Reserver;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
@@ -842,16 +843,10 @@ class SpelReproTests extends AbstractExpressionTests {
|
||||
void customStaticFunctions_SPR9038() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
List<MethodResolver> methodResolvers = new ArrayList<>();
|
||||
methodResolvers.add(new ReflectiveMethodResolver() {
|
||||
List<MethodResolver> methodResolvers = List.of(new ReflectiveMethodResolver() {
|
||||
@Override
|
||||
protected Method[] getMethods(Class<?> type) {
|
||||
try {
|
||||
return new Method[] {Integer.class.getDeclaredMethod("parseInt", String.class, Integer.TYPE)};
|
||||
}
|
||||
catch (NoSuchMethodException ex) {
|
||||
return new Method[0];
|
||||
}
|
||||
return new Method[] {ReflectionUtils.findMethod(Integer.class, "parseInt", String.class, int.class)};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+7
-11
@@ -20,13 +20,9 @@ import java.util.ArrayList;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.expression.BeanResolver;
|
||||
import org.springframework.expression.ConstructorResolver;
|
||||
import org.springframework.expression.MethodResolver;
|
||||
import org.springframework.expression.OperatorOverloader;
|
||||
import org.springframework.expression.PropertyAccessor;
|
||||
import org.springframework.expression.TypeConverter;
|
||||
import org.springframework.expression.TypeLocator;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -57,10 +53,10 @@ class StandardEvaluationContextTests {
|
||||
@Test
|
||||
void applyDelegatesToSetOverrideDelegatesInTarget() {
|
||||
StandardEvaluationContext target = new StandardEvaluationContext();
|
||||
target.setBeanResolver(mock(BeanResolver.class));
|
||||
target.setTypeLocator(mock(TypeLocator.class));
|
||||
target.setTypeConverter(mock(TypeConverter.class));
|
||||
target.setOperatorOverloader(mock(OperatorOverloader.class));
|
||||
target.setBeanResolver(mock());
|
||||
target.setTypeLocator(mock());
|
||||
target.setTypeConverter(mock());
|
||||
target.setOperatorOverloader(mock());
|
||||
target.setPropertyAccessors(new ArrayList<>());
|
||||
target.setConstructorResolvers(new ArrayList<>());
|
||||
target.setMethodResolvers(new ArrayList<>());
|
||||
@@ -79,7 +75,7 @@ class StandardEvaluationContextTests {
|
||||
void applyDelegatesToMakesACopyOfPropertyAccessors() {
|
||||
StandardEvaluationContext target = new StandardEvaluationContext();
|
||||
this.evaluationContext.applyDelegatesTo(target);
|
||||
PropertyAccessor propertyAccessor = mock(PropertyAccessor.class);
|
||||
PropertyAccessor propertyAccessor = mock();
|
||||
this.evaluationContext.getPropertyAccessors().add(propertyAccessor);
|
||||
assertThat(target.getPropertyAccessors()).doesNotContain(propertyAccessor);
|
||||
}
|
||||
@@ -88,7 +84,7 @@ class StandardEvaluationContextTests {
|
||||
void applyDelegatesToMakesACopyOfConstructorResolvers() {
|
||||
StandardEvaluationContext target = new StandardEvaluationContext();
|
||||
this.evaluationContext.applyDelegatesTo(target);
|
||||
ConstructorResolver methodResolver = mock(ConstructorResolver.class);
|
||||
ConstructorResolver methodResolver = mock();
|
||||
this.evaluationContext.getConstructorResolvers().add(methodResolver);
|
||||
assertThat(target.getConstructorResolvers()).doesNotContain(methodResolver);
|
||||
}
|
||||
@@ -97,7 +93,7 @@ class StandardEvaluationContextTests {
|
||||
void applyDelegatesToMakesACopyOfMethodResolvers() {
|
||||
StandardEvaluationContext target = new StandardEvaluationContext();
|
||||
this.evaluationContext.applyDelegatesTo(target);
|
||||
MethodResolver methodResolver = mock(MethodResolver.class);
|
||||
MethodResolver methodResolver = mock();
|
||||
this.evaluationContext.getMethodResolvers().add(methodResolver);
|
||||
assertThat(target.getMethodResolvers()).doesNotContain(methodResolver);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user