use of bio.terra.buffer.generated.model.GcpProjectConfig in project terra-resource-buffer by DataBiosphere.
the class PoolServiceTest method updateFromConfig_updateResourceConfigOnExistingPool_throwsException.
@Test
public void updateFromConfig_updateResourceConfigOnExistingPool_throwsException() throws Exception {
PoolId poolId = PoolId.create("poolId");
PoolConfig poolConfig = new PoolConfig().poolId(poolId.toString()).size(1).resourceConfigName(RESOURCE_CONFIG_NAME);
PoolWithResourceConfig parsedPoolConfig = PoolWithResourceConfig.create(poolConfig, newResourceConfig());
poolService.updateFromConfig(ImmutableList.of(parsedPoolConfig));
// Sets ResourceConfig's GCP project id prefix to newer value.
PoolWithResourceConfig updatedPoolConfig = PoolWithResourceConfig.create(poolConfig, newResourceConfig(new GcpProjectConfig().projectIdSchema(new ProjectIdSchema().prefix("aou-rw-test2").scheme(ProjectIdSchema.SchemeEnum.RANDOM_CHAR))));
assertThrows(RuntimeException.class, () -> poolService.updateFromConfig(ImmutableList.of(updatedPoolConfig)));
assertThat(bufferDao.retrievePools().stream().map(Pool::resourceConfig).collect(Collectors.toList()), Matchers.containsInAnyOrder(parsedPoolConfig.resourceConfig()));
}
use of bio.terra.buffer.generated.model.GcpProjectConfig in project terra-resource-buffer by DataBiosphere.
the class GoogleProjectConfigUtilsTest method userPrivateGoogleAccess.
@Test
public void userPrivateGoogleAccess() throws Exception {
GcpProjectConfig gcpProjectConfig = new GcpProjectConfig().network(new Network().enablePrivateGoogleAccess(false));
assertFalse(GoogleProjectConfigUtils.usePrivateGoogleAccess(gcpProjectConfig));
gcpProjectConfig.setNetwork(gcpProjectConfig.getNetwork().enableNetworkMonitoring(true));
assertTrue(GoogleProjectConfigUtils.usePrivateGoogleAccess(gcpProjectConfig));
}
Aggregations