All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javaswift.joss.command.mock.object.DeleteObjectCommandMock Maven / Gradle / Ivy

There is a newer version: 0.9.17
Show newest version
package org.javaswift.joss.command.mock.object;

import org.apache.http.HttpStatus;
import org.javaswift.joss.command.impl.core.httpstatus.HttpStatusChecker;
import org.javaswift.joss.command.impl.core.httpstatus.HttpStatusFailCondition;
import org.javaswift.joss.command.impl.core.httpstatus.HttpStatusMatch;
import org.javaswift.joss.command.impl.core.httpstatus.HttpStatusSuccessCondition;
import org.javaswift.joss.command.mock.core.CommandMock;
import org.javaswift.joss.command.shared.object.DeleteObjectCommand;
import org.javaswift.joss.model.Account;
import org.javaswift.joss.model.Container;
import org.javaswift.joss.model.StoredObject;
import org.javaswift.joss.swift.Swift;
import org.javaswift.joss.swift.SwiftResult;

public class DeleteObjectCommandMock extends CommandMock implements DeleteObjectCommand {

    public DeleteObjectCommandMock(Swift swift, Account account, Container container, StoredObject target) {
        super(swift, account, container, target);
    }

    @Override
    public SwiftResult callSwift() {
        return swift.deleteObject(container, object);
    }

    @Override
    public HttpStatusChecker[] getStatusCheckers() {
        return new HttpStatusChecker[] {
                new HttpStatusSuccessCondition(new HttpStatusMatch(HttpStatus.SC_NO_CONTENT)),
                new HttpStatusFailCondition(new HttpStatusMatch(HttpStatus.SC_NOT_FOUND))
        };
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy