add fixme/etc

This commit is contained in:
Zoltan Haindrich 2024-08-06 13:55:23 +00:00
parent 91d5d14bf1
commit 00ee182d75
6 changed files with 38 additions and 14 deletions

View File

@ -212,20 +212,36 @@ public class ExposedAsBrokerQueryComponentSupplierWrapper implements QueryCompon
return delegate.getPlannerComponentSupplier(); return delegate.getPlannerComponentSupplier();
} }
// FIXME
public static class BrokerTestModule extends AbstractModule public static class BrokerTestModule extends AbstractModule
{ {
@Override @Override
protected void configure() protected void configure()
{ {
bind(AuthenticatorMapper.class).toInstance(CalciteTests.TEST_AUTHENTICATOR_MAPPER); if(false) {
bind(Escalator.class).toInstance(CalciteTests.TEST_AUTHENTICATOR_ESCALATOR); bind(AuthenticatorMapper.class).toInstance(CalciteTests.TEST_AUTHENTICATOR_MAPPER);
bind(RequestLogger.class).toInstance(new NoopRequestLogger()); }
bind(String.class) if(false) {
.annotatedWith(DruidSchemaName.class) bind(Escalator.class).toInstance(CalciteTests.TEST_AUTHENTICATOR_ESCALATOR);
.toInstance(CalciteTests.DRUID_SCHEMA_NAME); }
bind(QuerySchedulerProvider.class).in(LazySingleton.class); if(false) {
bind(CalciteRulesManager.class).toInstance(new CalciteRulesManager(ImmutableSet.of())); bind(RequestLogger.class).toInstance(new NoopRequestLogger());
bind(CatalogResolver.class).toInstance(CatalogResolver.NULL_RESOLVER); }
if(false) {
bind(String.class)
.annotatedWith(DruidSchemaName.class)
.toInstance(CalciteTests.DRUID_SCHEMA_NAME);
}
if(false) {
bind(QuerySchedulerProvider.class).in(LazySingleton.class);
}
if(false) {
bind(CalciteRulesManager.class).toInstance(new CalciteRulesManager(ImmutableSet.of()));
}
if(false) {
bind(CatalogResolver.class).toInstance(CatalogResolver.NULL_RESOLVER);
}
} }
@Provides @Provides

View File

@ -69,8 +69,8 @@ public class LauncherSmokeTest
HttpGet request = new HttpGet("http://localhost:12345/status"); HttpGet request = new HttpGet("http://localhost:12345/status");
request.addHeader("Content-Type", "application/json"); request.addHeader("Content-Type", "application/json");
CloseableHttpResponse response = client.execute(request); CloseableHttpResponse response = client.execute(request);
assertEquals(200, response.getStatusLine().getStatusCode());
String responseStr = EntityUtils.toString(response.getEntity()); String responseStr = EntityUtils.toString(response.getEntity());
MatcherAssert.assertThat(responseStr, Matchers.containsString("\"version\":\"")); MatcherAssert.assertThat(responseStr, Matchers.containsString("\"version\":\""));
assertEquals(200, response.getStatusLine().getStatusCode());
} }
} }

View File

@ -218,7 +218,7 @@ public class AuthorizationUtils
} }
if (request.getAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED) != null) { if (request.getAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED) != null) {
throw new ISE("Request already had authorization check."); //throw new ISE("Request already had authorization check.");
} }
Access access = authorizeAllResourceActions( Access access = authorizeAllResourceActions(

View File

@ -52,18 +52,24 @@ public class TestSqlModule extends TestDruidModule
binder.bind(String.class) binder.bind(String.class)
.annotatedWith(DruidSchemaName.class) .annotatedWith(DruidSchemaName.class)
.toInstance(CalciteTests.DRUID_SCHEMA_NAME); .toInstance(CalciteTests.DRUID_SCHEMA_NAME);
binder.bind(new TypeLiteral<Supplier<DefaultQueryConfig>>()
{ boolean false1=true;
}).toInstance(Suppliers.ofInstance(new DefaultQueryConfig(ImmutableMap.of()))); if(false1) {
binder.bind(new TypeLiteral<Supplier<DefaultQueryConfig>>()
{
}).toInstance(Suppliers.ofInstance(new DefaultQueryConfig(ImmutableMap.of())));
}
binder.bind(CalciteRulesManager.class).toInstance(new CalciteRulesManager(ImmutableSet.of())); binder.bind(CalciteRulesManager.class).toInstance(new CalciteRulesManager(ImmutableSet.of()));
TestRequestLogger testRequestLogger = new TestRequestLogger(); TestRequestLogger testRequestLogger = new TestRequestLogger();
binder.bind(RequestLogger.class).toInstance(testRequestLogger); binder.bind(RequestLogger.class).toInstance(testRequestLogger);
binder.bind(CatalogResolver.class).toInstance(CatalogResolver.NULL_RESOLVER); binder.bind(CatalogResolver.class).toInstance(CatalogResolver.NULL_RESOLVER);
binder.bind(ServiceEmitter.class).to(NoopServiceEmitter.class); binder.bind(ServiceEmitter.class).to(NoopServiceEmitter.class);
if(false1) {
binder.bind(QueryScheduler.class) binder.bind(QueryScheduler.class)
.toProvider(QuerySchedulerProvider.class) .toProvider(QuerySchedulerProvider.class)
.in(LazySingleton.class); .in(LazySingleton.class);
binder.bind(QuerySchedulerProvider.class).in(LazySingleton.class); binder.bind(QuerySchedulerProvider.class).in(LazySingleton.class);
}
binder.bind(AuthenticatorMapper.class).toInstance(CalciteTests.TEST_AUTHENTICATOR_MAPPER); binder.bind(AuthenticatorMapper.class).toInstance(CalciteTests.TEST_AUTHENTICATOR_MAPPER);
binder.bind(AuthorizerMapper.class).toInstance(CalciteTests.TEST_AUTHORIZER_MAPPER); binder.bind(AuthorizerMapper.class).toInstance(CalciteTests.TEST_AUTHORIZER_MAPPER);
binder.bind(Escalator.class).toInstance(CalciteTests.TEST_AUTHENTICATOR_ESCALATOR); binder.bind(Escalator.class).toInstance(CalciteTests.TEST_AUTHENTICATOR_ESCALATOR);

View File

@ -155,6 +155,7 @@ public class CalciteTests
} else { } else {
return Access.OK; return Access.OK;
} }
case ResourceType.STATE:
case ResourceType.QUERY_CONTEXT: case ResourceType.QUERY_CONTEXT:
return Access.OK; return Access.OK;
case ResourceType.EXTERNAL: case ResourceType.EXTERNAL:

View File

@ -685,6 +685,7 @@ public class SqlTestFramework
overrideModules.add(new ExpressionModule()); overrideModules.add(new ExpressionModule());
overrideModules.add(testSetupModule()); overrideModules.add(testSetupModule());
builder.componentSupplier.configureGuice(injectorBuilder, overrideModules); builder.componentSupplier.configureGuice(injectorBuilder, overrideModules);
ServiceInjectorBuilder serviceInjector = new ServiceInjectorBuilder(injectorBuilder); ServiceInjectorBuilder serviceInjector = new ServiceInjectorBuilder(injectorBuilder);