Adds unit tests for all services
This commit is contained in:
@@ -9,27 +9,24 @@ import { RequestContext } from '../_context/request.context';
|
||||
type QueryParams = {
|
||||
AttributeName: string;
|
||||
AttributeValue: string;
|
||||
TopicArn: string;
|
||||
}
|
||||
SubscriptionArn: string;
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
export class SetSubscriptionAttributesHandler extends AbstractActionHandler<QueryParams> {
|
||||
|
||||
constructor(
|
||||
private readonly attributeService: AttributesService,
|
||||
) {
|
||||
constructor(private readonly attributeService: AttributesService) {
|
||||
super();
|
||||
}
|
||||
|
||||
format = Format.Xml;
|
||||
action = Action.SnsSetSubscriptionAttributes;
|
||||
validator = Joi.object<QueryParams, true>({
|
||||
validator = Joi.object<QueryParams, true>({
|
||||
AttributeName: Joi.string().required(),
|
||||
AttributeValue: Joi.string().required(),
|
||||
TopicArn: Joi.string().required(),
|
||||
SubscriptionArn: Joi.string().required(),
|
||||
});
|
||||
|
||||
protected async handle({ AttributeName, AttributeValue, TopicArn }: QueryParams, { awsProperties} : RequestContext) {
|
||||
await this.attributeService.create({ name: AttributeName, value: AttributeValue, arn: TopicArn });
|
||||
protected async handle({ AttributeName, AttributeValue, SubscriptionArn }: QueryParams, { awsProperties }: RequestContext) {
|
||||
await this.attributeService.create({ name: AttributeName, value: AttributeValue, arn: SubscriptionArn });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user