use of com.yahoo.vespa.config.server.application.Application in project vespa by vespa-engine.
the class RpcServerTest method testEnabled.
private void testEnabled() throws IOException, SAXException {
generationCounter.increment();
Application app = new Application(new VespaModel(MockApplicationPackage.createEmpty()), new ServerCache(), 2l, Version.fromIntValues(1, 2, 3), MetricUpdater.createTestUpdater(), ApplicationId.defaultId());
ApplicationSet appSet = ApplicationSet.fromSingle(app);
rpcServer.configActivated(TenantName.defaultName(), appSet);
ConfigKey<?> key = new ConfigKey<>(LbServicesConfig.class, "*");
JRTClientConfigRequest clientReq = JRTClientConfigRequestV3.createFromRaw(new RawConfig(key, LbServicesConfig.CONFIG_DEF_MD5), 120_000, Trace.createDummy(), CompressionType.UNCOMPRESSED, Optional.empty());
assertTrue(clientReq.validateParameters());
performRequest(clientReq.getRequest());
assertFalse(clientReq.validateResponse());
assertThat(clientReq.errorCode(), is(ErrorCode.APPLICATION_NOT_LOADED));
rpcServer.onTenantsLoaded();
clientReq = JRTClientConfigRequestV3.createFromRaw(new RawConfig(key, LbServicesConfig.CONFIG_DEF_MD5), 120_000, Trace.createDummy(), CompressionType.UNCOMPRESSED, Optional.empty());
assertTrue(clientReq.validateParameters());
performRequest(clientReq.getRequest());
boolean validResponse = clientReq.validateResponse();
assertTrue(clientReq.errorMessage(), validResponse);
assertThat(clientReq.errorCode(), is(0));
}
Aggregations