Class DummySmsClient
java.lang.Object
ch.tocco.nice2.optional.sms.api.services.DummySmsClient
- All Implemented Interfaces:
SmsClient
A dummy client that simply creates response objects without
involving networking or other resources.
To use this client, adopt the application.properties to contain
`sms.provider=dummy`.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.optional.sms.api.services.SmsClient
SmsClient.Sms, SmsClient.SmsRecipient, SmsClient.SmsResponse -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckSmsRecipient(Entity smsRecipient) Checks whether the given entity is a valid sms recipient for this SmsClient or notbooleancheckSmsResponse(SmsClient.SmsResponse smsResponse) Checks whether the given response was created by this client and is a successful response.getName()sendSms(SmsClient.Sms sms, boolean simulateSms) Creates a response for any given sms.
-
Constructor Details
-
DummySmsClient
public DummySmsClient()
-
-
Method Details
-
getName
-
sendSms
Creates a response for any given sms. The `simulateSms` flag is ignored. The sms message can contain trailing property lines like in git commit messages that can contain properties to control some behavior: - `Error:true` makes the client return a failed message - `Sleep:200` makes the client thread sleep for the specified amount of milliseconds These properties must be one at a line and the whole block must be separated by an empty line to the previous text. Keys are case insensitive. -
checkSmsResponse
Checks whether the given response was created by this client and is a successful response.- Specified by:
checkSmsResponsein interfaceSmsClient- Returns:
- true if the sms has been sent correctly.
-
checkSmsRecipient
Description copied from interface:SmsClientChecks whether the given entity is a valid sms recipient for this SmsClient or not- Specified by:
checkSmsRecipientin interfaceSmsClient- Returns:
- true if the given entity is a valid sms recipient
-