summaryrefslogtreecommitdiff
path: root/eaaf_core/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_core/src/test/java')
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/controller/ProtocolFinalizationControllerTest.java29
1 files changed, 12 insertions, 17 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/controller/ProtocolFinalizationControllerTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/controller/ProtocolFinalizationControllerTest.java
index 4341d141..e165f84b 100644
--- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/controller/ProtocolFinalizationControllerTest.java
+++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/controller/ProtocolFinalizationControllerTest.java
@@ -19,7 +19,6 @@ import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.util.SerializationUtils;
import at.gv.egiz.eaaf.core.api.data.EaafConfigConstants;
import at.gv.egiz.eaaf.core.api.data.EaafConstants;
@@ -107,8 +106,7 @@ public class ProtocolFinalizationControllerTest {
protocolRequest.setSpConfig(new DummySpConfiguration(spConfig, config));
Throwable throwable = new EaafException("internal.00");
final ExceptionContainer exceptionContainer = new ExceptionContainer(protocolRequest, throwable);
- final byte[] serialized = SerializationUtils.serialize(exceptionContainer);
- storage.put(token, serialized, -1);
+ storage.put(token, exceptionContainer, -1);
// perform test
controller.errorRedirect(httpReq, httpResp);
@@ -174,8 +172,7 @@ public class ProtocolFinalizationControllerTest {
protocolRequest.setSpConfig(new DummySpConfiguration(spConfig, config));
Throwable throwable = new EaafException("internal.00");
final ExceptionContainer exceptionContainer = new ExceptionContainer(protocolRequest, throwable);
- final byte[] serialized = SerializationUtils.serialize(exceptionContainer);
- storage.put(token, serialized, -1);
+ storage.put(token, exceptionContainer, -1);
// perform test
controller.errorHandling(httpReq, httpResp);
@@ -218,8 +215,7 @@ public class ProtocolFinalizationControllerTest {
Throwable throwable = new EaafException("internal.00");
final ExceptionContainer exceptionContainer = new ExceptionContainer(protocolRequest, throwable);
- final byte[] serialized = SerializationUtils.serialize(exceptionContainer);
- storage.put(token, serialized, -1);
+ storage.put(token, exceptionContainer, -1);
String secondErrorTicket = requestIdValidationStragegy.generateExternalPendingRequestId();
errorService.setErrorIdTokenForRedirect(secondErrorTicket);
@@ -241,10 +237,10 @@ public class ProtocolFinalizationControllerTest {
assertEquals("wrong intErrorCode", "internal.00", params.get("errorCode"));
assertTrue("wrong extErrorCode", ((String) params.get("extErrorCode")).contains("internal.00"));
- byte[] secondErrorSerialized = storage.get(
- requestIdValidationStragegy.getPendingRequestIdWithOutChecks(secondErrorTicket), byte[].class);
- assertNotNull("Exception not removed from cache", secondErrorSerialized);
- ExceptionContainer secondError = (ExceptionContainer) SerializationUtils.deserialize(secondErrorSerialized);
+ ExceptionContainer secondError = storage.get(
+ requestIdValidationStragegy.getPendingRequestIdWithOutChecks(secondErrorTicket),
+ ExceptionContainer.class);
+ assertNotNull("Exception not removed from cache", secondError);
assertEquals("wrong pengingReq", protocolRequest.getUniqueTransactionIdentifier(),
secondError.getPendingRequest().getUniqueTransactionIdentifier());
assertEquals("wrong exception", throwable.getMessage(), secondError.getExceptionThrown().getMessage());
@@ -274,8 +270,7 @@ public class ProtocolFinalizationControllerTest {
Throwable throwable = new EaafException("internal.00");
final ExceptionContainer exceptionContainer = new ExceptionContainer(protocolRequest, throwable);
- final byte[] serialized = SerializationUtils.serialize(exceptionContainer);
- storage.put(token, serialized, -1);
+ storage.put(token, exceptionContainer, -1);
String secondErrorTicket = requestIdValidationStragegy.generateExternalPendingRequestId();
errorService.setErrorIdTokenForRedirect(secondErrorTicket);
@@ -296,10 +291,10 @@ public class ProtocolFinalizationControllerTest {
assertEquals("wrong intErrorCode", "internal.00", params.get("errorCode"));
assertTrue("wrong extErrorCode", ((String) params.get("extErrorCode")).contains("internal.00"));
- byte[] secondErrorSerialized = storage.get(
- requestIdValidationStragegy.getPendingRequestIdWithOutChecks(secondErrorTicket), byte[].class);
- assertNotNull("Exception not removed from cache", secondErrorSerialized);
- ExceptionContainer secondError = (ExceptionContainer) SerializationUtils.deserialize(secondErrorSerialized);
+ ExceptionContainer secondError = storage.get(
+ requestIdValidationStragegy.getPendingRequestIdWithOutChecks(secondErrorTicket),
+ ExceptionContainer.class);
+ assertNotNull("Exception not removed from cache", secondError);
assertEquals("wrong pengingReq", protocolRequest.getUniqueTransactionIdentifier(),
secondError.getPendingRequest().getUniqueTransactionIdentifier());
assertEquals("wrong exception", throwable.getMessage(), secondError.getExceptionThrown().getMessage());