Skip to content

Commit

Permalink
allows all array types as input parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
uklimaschewski committed Mar 18, 2024
1 parent 534a6bd commit dc2e308
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class DefaultEvaluationValueConverter implements EvaluationValueConverter
new ArrayConverter(),
new StructureConverter());

@Override
public EvaluationValue convertObject(Object object, ExpressionConfiguration configuration) {

if (object == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import com.ezylang.evalex.config.ExpressionConfiguration;
import com.ezylang.evalex.data.conversion.DefaultEvaluationValueConverter;
import java.util.Optional;
import org.junit.jupiter.api.Test;

class DefaultEvaluationValueConverterTest {
Expand All @@ -47,7 +46,8 @@ void testNestedEvaluationValueNull() {

@Test
void testException() {
assertThatThrownBy(() -> converter.convertObject(Optional.of(1), defaultConfiguration))
final Error error = new Error();
assertThatThrownBy(() -> converter.convertObject(error, defaultConfiguration))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Unsupported data type 'java.util.Optional'");
}
Expand Down

0 comments on commit dc2e308

Please sign in to comment.