### Question:
AutoConfigure { public void load(final AzkarraApplication application) { LOG.info("Loading application configuration"); Objects.requireNonNull(application, "application cannot be null"); AzkarraContext context = application.getContext(); if (context == null) { LOG.info("No AzkarraContext provided, initializing default provided implementation"); application.setContext(DefaultAzkarraContext.create()); } final Class<?> mainApplicationClass = application.getMainApplicationClass(); final Optional<String> autoConfig = loadAutoConfigIfEnable(mainApplicationClass); autoConfig.ifPresent(configBasename -> { if (configBasename.isEmpty()) application.addConfiguration(AzkarraConf.create()); else { application.addConfiguration(AzkarraConf.create(configBasename)); } }); isHttpServerEnable(mainApplicationClass) .ifPresent(application::enableHttpServer); loadAutoStartEnvironmentNameIfEnable(mainApplicationClass) .ifPresent(env -> application.setAutoStart(true, env)); isComponentScanEnable(mainApplicationClass) .ifPresent(application::setEnableComponentScan); } AutoConfigure(); void load(final AzkarraApplication application);  }### Answer:
@Test public void shouldLoadDefaultConfigsFromSystem(final @TempDir Path tempDir) throws IOException { createTempConfigProperties(tempDir); final AzkarraApplication application = new AzkarraApplication() { public Class<?> getMainApplicationClass() { return ClassWithDefaultAutoConfig.class; } }; new AutoConfigure().load(application); Conf configuration = application.getConfiguration(); assertEquals(TEST_PROPERTY_VALUE, configuration.getString(TEST_SYSTEM_PROPERTY_NAME)); }
@Test public void shouldLoadCustomConfigs() { final AzkarraApplication application = new AzkarraApplication() { public Class<?> getMainApplicationClass() { return ClassWithCustomAutoConfig.class; } }; new AutoConfigure().load(application); Conf configuration = application.getConfiguration(); assertEquals(TEST_PROPERTY_VALUE, configuration.getString(TEST_CUSTOM_PROPERTY_NAME)); }