com.github.mlk.junit.rules.S3MockRuleBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assortmentofjunitrules Show documentation
Show all versions of assortmentofjunitrules Show documentation
Useful assortment of JUnit rules for integration testing
package com.github.mlk.junit.rules;
import com.github.mlk.junit.rules.S3MockRule.FakeFile;
import java.util.LinkedHashSet;
import java.util.Set;
public class S3MockRuleBuilder {
private final Set buckets = new LinkedHashSet<>();
private final Set files = new LinkedHashSet<>();
public S3MockRuleBuilder bucket(String bucketName) {
buckets.add(bucketName);
return this;
}
public S3MockRule build() {
return new S3MockRule(buckets, files);
}
public S3MockRuleBuilder file(String bucketName, String fileName, String content) {
files.add(new FakeFile(bucketName, fileName, content));
buckets.add(bucketName);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy