Search in sources :

Example 1 with RestApiModule

use of com.google.gerrit.extensions.restapi.RestApiModule in project gerrit by GerritCodeReview.

the class TestPluginModule method configure.

@Override
protected void configure() {
    bind(CapabilityDefinition.class).annotatedWith(Exports.named(PLUGIN_CAPABILITY)).toInstance(new CapabilityDefinition() {

        @Override
        public String getDescription() {
            return "Print Hello";
        }
    });
    install(new RestApiModule() {

        @Override
        protected void configure() {
            DynamicMap.mapOf(binder(), PLUGIN_KIND);
            child(CONFIG_KIND, PLUGIN_COLLECTION).to(PluginCollection.class);
            get(PLUGIN_KIND).to(GetTestPlugin.class);
            create(PLUGIN_KIND).to(CreateTestPlugin.class);
        }
    });
}
Also used : RestApiModule(com.google.gerrit.extensions.restapi.RestApiModule) CapabilityDefinition(com.google.gerrit.extensions.config.CapabilityDefinition)

Aggregations

CapabilityDefinition (com.google.gerrit.extensions.config.CapabilityDefinition)1 RestApiModule (com.google.gerrit.extensions.restapi.RestApiModule)1