Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code dedupe part 1 (api module) #149

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 34 additions & 16 deletions modules/api/src/main/java/com/intuit/wasabi/api/ApiModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,8 @@ public class ApiModule extends AbstractModule {

@Override
protected void configure() {
LOGGER.debug("installing module: {}", ApiModule.class.getSimpleName());
//these modules are either free of other dependencies or they are required by later modules
install(new com.intuit.autumn.api.ApiModule());
install(new UserDirectoryModule());
install(new DatabaseExperimentRepositoryModule());
install(new DatabaseModule());
install(new JacksonModule());
install(new AuditLogModule());
install(new AuthorizationModule());

install(new EmailModule());
install(new EventsModule());
install(new ExperimentsModule());
install(new FeedbackModule());
install(new AnalyticsModule());

installModules();

Properties properties = create(PROPERTY_NAME, ApiModule.class);

Expand Down Expand Up @@ -101,6 +87,38 @@ protected void configure() {
// e.printStackTrace();
// }

LOGGER.debug("installed module: {}", ApiModule.class.getSimpleName());
}

protected void installUserModule() {
install(new UserDirectoryModule());
}

protected void installAuthModule() {
install(new AuthorizationModule());
}

protected void installEventModule() {
install(new EventsModule());
}

private void installModules() {
LOGGER.debug("installing module: {}", ApiModule.class.getCanonicalName());

//these modules are either free of other dependencies or they are required by later modules
install(new com.intuit.autumn.api.ApiModule());
installUserModule();
install(new DatabaseExperimentRepositoryModule());
install(new DatabaseModule());
install(new JacksonModule());
install(new AuditLogModule());
installAuthModule();

install(new EmailModule());
installEventModule();
install(new ExperimentsModule());
install(new FeedbackModule());
install(new AnalyticsModule());

LOGGER.debug("installed module: {}", ApiModule.class.getCanonicalName());
}
}