use of com.yahoo.vespa.config.server.MockReloadHandler in project vespa by vespa-engine.
the class TenantApplicationsTest method require_that_reload_handler_is_called_when_apps_are_removed.
@Test
public void require_that_reload_handler_is_called_when_apps_are_removed() throws Exception {
ApplicationId foo = createApplicationId("foo");
writeApplicationData(foo, 3L);
writeApplicationData(createApplicationId("bar"), 4L);
MockReloadHandler reloadHandler = new MockReloadHandler();
TenantApplications repo = createZKAppRepo(reloadHandler);
assertNull(reloadHandler.lastRemoved);
repo.deleteApplication(foo).commit();
long endTime = System.currentTimeMillis() + 60_000;
while (System.currentTimeMillis() < endTime && reloadHandler.lastRemoved == null) {
Thread.sleep(100);
}
assertNotNull(reloadHandler.lastRemoved);
assertThat(reloadHandler.lastRemoved.serializedForm(), is(foo.serializedForm()));
}
use of com.yahoo.vespa.config.server.MockReloadHandler in project vespa by vespa-engine.
the class ApplicationHandlerTest method setup.
@Before
public void setup() {
TestTenantBuilder testBuilder = new TestTenantBuilder();
testBuilder.createTenant(mytenantName).withReloadHandler(new MockReloadHandler());
testBuilder.createTenant(foobar).withReloadHandler(new MockReloadHandler());
tenants = testBuilder.createTenants();
provisioner = new SessionHandlerTest.MockProvisioner();
mockHandler = createMockApplicationHandler(provisioner, new ApplicationConvergenceChecker(stateApiFactory), mockHttpProxy, new MockLogServerLogGrabber());
listApplicationsHandler = new ListApplicationsHandler(ListApplicationsHandler.testOnlyContext(), tenants, Zone.defaultZone());
}
Aggregations