Package org.opensaml.profile.action.impl
Class EncodeMessageTest.MockMessageEncoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.encoder.AbstractMessageEncoder
org.opensaml.profile.action.impl.EncodeMessageTest.MockMessageEncoder
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,MessageEncoder
- Enclosing class:
- EncodeMessageTest
Mock implementation of
MessageEncoder which either returns a
MessageContext with a mock message or throws a MessageDecodingException.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringMock encoded message.private booleanWhether aMessageEncodingExceptionshould be thrown bydoEncode().Fields inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoEncode()Get the encoded messagevoidsetThrowException(boolean shouldThrowDecodeException) Sets whether aMessageEncodingExceptionshould be thrown bydoEncode().Methods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
doInitialize, encode, getMessageContext, getMessageToLog, getProtocolMessageLogger, getProtocolMessageLoggerSubCategory, logEncodedMessage, prepareContext, serializeMessageForLogging, setMessageContext, setProtocolMessageLoggerSubCategoryMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
throwException
private boolean throwExceptionWhether aMessageEncodingExceptionshould be thrown bydoEncode(). -
message
Mock encoded message.
-
-
Constructor Details
-
MockMessageEncoder
private MockMessageEncoder()
-
-
Method Details
-
getEncodedMessage
Get the encoded message- Returns:
- the string buffer
-
setThrowException
public void setThrowException(boolean shouldThrowDecodeException) Sets whether aMessageEncodingExceptionshould be thrown bydoEncode().- Parameters:
shouldThrowDecodeException- true if an exception should be thrown, false if not
-
doEncode
- Specified by:
doEncodein classAbstractMessageEncoder- Throws:
MessageEncodingException
-