@BeforeMethod
public void setup() {
image = org.jclouds.digitalocean2.domain.Image.create(1, "14.04 x64",
"distribution", "Ubuntu", "ubuntu-1404-x86", true, ImmutableList.of("sfo1"), new Date(), 20, 20);
region = Region.create("sfo1", "San Francisco 1", ImmutableList.of("2gb"), true, ImmutableList.<String> of());
images = ImmutableSet.of(new ImageBuilder()
.id("sfo1/ubuntu-1404-x86")
.providerId("1")
.name("mock image")
.status(AVAILABLE)
.operatingSystem(
OperatingSystem.builder().name("Ubuntu 14.04 x86_64").description("Ubuntu").family(OsFamily.UBUNTU)
.version("10.04").arch("x86_64").is64Bit(true).build()).build());
hardwares = ImmutableSet.of(new HardwareBuilder().id("2gb").providerId("2gb").name("mock hardware")
.processor(new Processor(1.0, 1.0)).ram(2048)
.volume(new VolumeBuilder().size(20f).type(Type.LOCAL).build()).build());
locations = ImmutableSet.of(new LocationBuilder()
.id("sfo1")
.description("sfo1/San Francisco 1")
.scope(LocationScope.REGION)
.parent(
new LocationBuilder().id("0").description("mock parent location").scope(LocationScope.PROVIDER)
.build()).build());
credentials = LoginCredentials.builder().user("foo").password("bar").build();
function = createNodeParser(hardwares, images, locations, ImmutableMap.of("node#1", (Credentials) credentials));
}