use of com.google.appengine.tools.development.testing.LocalCapabilitiesServiceTestConfig in project java-docs-samples by GoogleCloudPlatform.
the class ShortTest method testDisabledDatastore.
@Test(expected = ApiProxy.CapabilityDisabledException.class)
public void testDisabledDatastore() {
Capability testOne = new Capability("datastore_v3");
CapabilityStatus testStatus = CapabilityStatus.DISABLED;
// Initialize the test configuration.
LocalCapabilitiesServiceTestConfig config = new LocalCapabilitiesServiceTestConfig().setCapabilityStatus(testOne, testStatus);
helper = new LocalServiceTestHelper(config);
helper.setUp();
FetchOptions fo = FetchOptions.Builder.withLimit(10);
DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
assertEquals(0, ds.prepare(new Query("yam")).countEntities(fo));
}
Aggregations