Polish contribution

See gh-25367
This commit is contained in:
Sam Brannen
2020-07-16 15:39:36 +02:00
parent 35c0ae7b0c
commit b0570cd3a6
3 changed files with 23 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -203,22 +203,21 @@ public class IndexingTests {
public List<BigDecimal> decimals;
@Test
public void autoGrowWithoutDefaultConstructor() {
public void autoGrowListOfElementsWithoutDefaultConstructor() {
this.decimals = new ArrayList<>();
SpelExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
parser.parseExpression("decimals[0]").setValue(this, "123.4");
assertThat(decimals.get(0)).isEqualTo(BigDecimal.valueOf(123.4));
assertThat(decimals).containsExactly(BigDecimal.valueOf(123.4));
}
@Test
public void indexIntoPropertyContainingNullList() {
public void indexIntoPropertyContainingListContainingNullElement() {
this.decimals = new ArrayList<>();
this.decimals.add(null);
this.decimals.add(BigDecimal.ONE);
SpelExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
parser.parseExpression("decimals[0]").setValue(this, "9876.5");
assertThat(decimals.get(0)).isEqualTo(BigDecimal.valueOf(9876.5));
assertThat(decimals.get(1)).isEqualTo(BigDecimal.ONE);
assertThat(decimals).containsExactly(BigDecimal.valueOf(9876.5), BigDecimal.ONE);
}
@Test