@RunWith(Arquillian.class)
public class ConfigTest extends DatastoreTestBase {
@Test
public void testConfigBuilder() {
DatastoreServiceConfig config = DatastoreServiceConfig.Builder.withDefaults();
assertEquals(new ReadPolicy(Consistency.STRONG).getConsistency(), config.getReadPolicy().getConsistency());
config = DatastoreServiceConfig.Builder.withDeadline(10);
assertEquals(new Double(10), config.getDeadline());
config.deadline(20);
assertEquals(new Double(20), config.getDeadline());
config = DatastoreServiceConfig.Builder.withImplicitTransactionManagementPolicy(ImplicitTransactionManagementPolicy.AUTO);
assertEquals(ImplicitTransactionManagementPolicy.AUTO, config.getImplicitTransactionManagementPolicy());
config.implicitTransactionManagementPolicy(ImplicitTransactionManagementPolicy.NONE);
assertEquals(ImplicitTransactionManagementPolicy.NONE, config.getImplicitTransactionManagementPolicy());
config = DatastoreServiceConfig.Builder.withMaxEntityGroupsPerRpc(5);
assertEquals(new Integer(5), config.getMaxEntityGroupsPerRpc());
config.maxEntityGroupsPerRpc(2);
assertEquals(new Integer(2), config.getMaxEntityGroupsPerRpc());
config = DatastoreServiceConfig.Builder.withReadPolicy(new ReadPolicy(Consistency.EVENTUAL));
assertEquals(new ReadPolicy(Consistency.EVENTUAL).getConsistency(), config.getReadPolicy().getConsistency());
config.readPolicy(new ReadPolicy(Consistency.STRONG));
assertEquals(new ReadPolicy(Consistency.STRONG).getConsistency(), config.getReadPolicy().getConsistency());
}