package cz.moneta.test.dsl.util.task.paemq;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.payment_engine_mq.MessagingType;
import cz.moneta.test.harness.support.rest.RawRestRequest;

public class PaeMqTasks {
    private final Harness harness;

    public PaeMqTasks(Harness harness) {
        this.harness = harness;
    }

    public RawRestRequest.Request prepareEmptyRequest(MessagingType messagingType) {
        return this.harness.withPaeMq().prepareRequest(messagingType);
    }

    public RawRestRequest.Post prepareRequest(MessagingType messagingType, String payload) {
        return this.harness.withPaeMq().prepareRequest(messagingType)
                .withPayload(payload);
    }

    public void uploadFile(MessagingType messagingType, String file) {
        prepareRequest(messagingType, file).post().andAssertStatus(201);
    }

}
