From ae0e8dbdded2acf47007a20dcd878d2b51178b97 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 20 Aug 2019 15:59:38 +0200 Subject: some small fixes --- .../eaaf/core/impl/idp/module/test/TestRequestImpl.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'eaaf_core/src/test') diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java index ceb4d9fe..80451399 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java @@ -26,10 +26,13 @@ *******************************************************************************/ package at.gv.egiz.eaaf.core.impl.idp.module.test; +import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; +import org.apache.commons.lang3.StringUtils; + import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration; import at.gv.egiz.eaaf.core.exceptions.EAAFStorageException; @@ -271,6 +274,18 @@ public class TestRequestImpl implements IRequest { @Override public void setRawDataToTransaction(String key, Object object) throws EAAFStorageException { + if (StringUtils.isEmpty(key)) { + throw new EAAFStorageException("Generic request-data can not be stored with a 'null' key", null); + + } + + if (object != null) { + if (!Serializable.class.isInstance(object)) { + throw new EAAFStorageException("Generic request-data can only store objects which implements the 'Seralizable' interface", null); + + } + } + storage.put(key, object); } -- cgit v1.2.3