diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java index 90b4e2a3b..0b76b1005 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2014 the original author or authors. + * Copyright 2010-2022 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. @@ -19,6 +19,8 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.thoughtworks.xstream.security.ExplicitTypePermission; + import org.springframework.batch.item.xml.domain.Trade; import org.springframework.oxm.Unmarshaller; import org.springframework.oxm.xstream.XStreamMarshaller; @@ -38,6 +40,7 @@ public class XStreamUnmarshallingTests extends AbstractStaxEventReaderItemReader unmarshaller.addAlias("customer", String.class); unmarshaller.addAlias("price", BigDecimal.class);*/ unmarshaller.setAliases(aliasesMap); + unmarshaller.setTypePermissions(new ExplicitTypePermission(new Class[]{org.springframework.batch.item.xml.domain.Trade.class})); return unmarshaller; }