package org.col;

import java.io.IOException;
import java.io.InputStream;
import javax.validation.Validator;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.dropwizard.configuration.ConfigurationSourceProvider;
import io.dropwizard.configuration.YamlConfigurationFactory;
import io.dropwizard.jackson.Jackson;
import io.dropwizard.jersey.validation.Validators;
import org.assertj.core.api.Assertions;
import org.col.common.io.Resources;
import org.col.dw.auth.map.MapAuthenticationFactory;
import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;

public class WsServerConfigTest {
  
  private static final ObjectMapper objectMapper = Jackson.newObjectMapper();
  private static final Validator validator = Validators.newValidator();
  private static final YamlConfigurationFactory<WsServerConfig> factory =
      new YamlConfigurationFactory<>(WsServerConfig.class, validator, objectMapper, "dw");
  
  @Test
  public static WsServerConfig readTestConfig() throws Exception {
    // File cfgFile = new File(ResourceHelpers.resourceFilePath("config-test.yaml"));
    //return factory.build(cfgFile);
    return factory.build(new ConfigurationSourceProvider() {
      @Override
      public InputStream open(String path) throws IOException {
        return Resources.stream(path);
      }
    }, "config-test.yaml");
  }

  @Test
  public void testBuildAppCfg() throws Exception {
    final WsServerConfig cfg = readTestConfig();
    assertNotNull(cfg.auth);
    Assertions.assertThat(cfg.auth).isInstanceOf(MapAuthenticationFactory.class);
    
    String version = cfg.versionString();
    System.out.println(version);
    assertNotNull(version);
    assertFalse(version.contains("{"));
  }
}
@@ -968,24 +968,16 @@
 w%22);%0A  %0A
-  @Test%0A
   public
@@ -1039,131 +1039,8 @@
 n %7B%0A
-    // File cfgFile = new File(ResourceHelpers.resourceFilePath(%22config-test.yaml%22));%0A    //return factory.build(cfgFile);%0A
     

Remove unintended test