Java 类io.dropwizard.testing.ResourceHelpers 实例源码

项目:dropwizard-http2-client    文件:Http2ClientIntegrationTest.java   
@Test
public void testH2() throws Exception {
    JettyClientConfiguration h2conf = new JettyClientConfiguration();
    Http2ClientTransportFactory h2transport = new Http2ClientTransportFactory();
    h2transport.setTrustStorePath(ResourceHelpers.resourceFilePath("stores/h2_client.jts"));
    h2transport.setTrustStorePassword("h2_client");
    h2transport.setValidatePeers(false);
    h2conf.setConnectionFactoryBuilder(h2transport);

    HttpClient client = new JettyClientBuilder(environment)
            .using(h2conf)
            .build();
    String response = client.GET(String.format("https://127.0.0.1:%d/application/greet", h2.getLocalPort()))
            .getContentAsString();
    assertThat(objectMapper.readTree(response))
            .isEqualTo(objectMapper.readTree(FixtureHelpers.fixture("server_response.json")));
}
项目:atam4j    文件:Atam4jApplicationStarter.java   
public static DropwizardTestSupport<ApplicationConfiguration> startApplicationWith(
        int initialDelayInMillis, Class testClass, int periodInMillis) {

    ConfigOverride[] configOverrides = {
        ConfigOverride.config("testClasses", testClass.getName()),
        ConfigOverride.config("initialDelayInMillis", String.valueOf(initialDelayInMillis)),
        ConfigOverride.config("periodInMillis", String.valueOf(periodInMillis))
    };

    DropwizardTestSupport<ApplicationConfiguration> applicationConfigurationDropwizardTestSupport =
            new DropwizardTestSupport<>(Atam4jTestApplication.class,
                    ResourceHelpers.resourceFilePath("atam4j-config.yml"),
                    configOverrides);

    applicationConfigurationDropwizardTestSupport.before();
    return applicationConfigurationDropwizardTestSupport;
}
项目:verify-hub    文件:SamlEngineAppRule.java   
public SamlEngineAppRule(boolean isCountryEnabled, ConfigOverride... configOverrides) {
    super(SamlEngineIntegrationApplication.class,
            ResourceHelpers.resourceFilePath("saml-engine.yml"),
            withDefaultOverrides(isCountryEnabled, configOverrides)
    );
    BootstrapUtils.reset();
}
项目:dropwizard-pac4j    文件:AbstractApplicationTest.java   
public void setup(
        Class<? extends Application<TestConfiguration>> applicationClass,
        String configPath, ConfigOverride... configOverrides) {
    dropwizardTestSupport = new DropwizardTestSupport<>(applicationClass,
            ResourceHelpers.resourceFilePath(configPath), configOverrides);
    dropwizardTestSupport.before();
}
项目:openregister-java    文件:RegisterRule.java   
public RegisterRule() {
    this.appRule = new DropwizardAppRule<>(RegisterApplication.class,
            ResourceHelpers.resourceFilePath("test-app-config.yaml"));
    wipeRule = new WipeDatabaseRule(TestRegister.values());
    wholeRule = RuleChain
            .outerRule(appRule)
            .around(wipeRule);
}
项目:openregister-java    文件:FieldsConfigurationTest.java   
@Test
public void loadConfigurationWithExternalPathOfFieldsResourceFile() throws URISyntaxException {
    @SuppressWarnings("ConstantConditions")
    String fileUrl = ResourceHelpers.resourceFilePath("config/fields.yaml");

    FieldsConfiguration fieldsConfiguration = new FieldsConfiguration(fileUrl);

    assertThat(fieldsConfiguration.getField("register").get().fieldName, equalTo("register"));
}
项目:dropwizard-sundial    文件:SundialBundleITBase.java   
public static DropwizardAppRule<TestConfiguration> buildApp(
    String configFile, final Before before
) {
    return new DropwizardAppRule<>(
        new DropwizardTestSupport<TestConfiguration>(
            TestApp.class, ResourceHelpers.resourceFilePath(configFile)
        ) {
            @Override
            public void before() {
                super.before();
                before.before(getEnvironment());
            }
        }
    );
}
项目:verify-hub    文件:SamlProxyAppRule.java   
public SamlProxyAppRule(boolean isCountryEnabled, ConfigOverride... configOverrides) {
    super(SamlProxyApplication.class,
            ResourceHelpers.resourceFilePath("saml-proxy.yml"),
            withDefaultOverrides(isCountryEnabled, configOverrides)
    );
}
项目:verify-hub    文件:CountryAuthnResponseTranslatorServiceTest.java   
private SAMLObject buildResponseFromFile() throws IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, org.opensaml.core.xml.io.UnmarshallingException {
    String xmlString = new String(Files.readAllBytes(Paths.get(ResourceHelpers.resourceFilePath("EIDASAMLResponse.xml"))));
    return (Response) new SamlObjectParser().getSamlObject(xmlString);
}
项目:verify-hub    文件:ConfigAppRule.java   
public ConfigAppRule(ConfigOverride... configOverrides) {
    super(ConfigApplication.class,
            ResourceHelpers.resourceFilePath("config.yml"),
            withDefaultOverrides(configOverrides)
    );
}
项目:verify-matching-service-adapter    文件:MatchingServiceAdapterAppRule.java   
public MatchingServiceAdapterAppRule(boolean isCountryEnabled, ConfigOverride... otherConfigOverrides) {
    super(MatchingServiceAdapterApplication.class,
            ResourceHelpers.resourceFilePath("verify-matching-service-adapter.yml"),
            MatchingServiceAdapterAppRule.withDefaultOverrides(isCountryEnabled, otherConfigOverrides)
    );
}
项目:coner-core    文件:IntegrationTestUtils.java   
public static DropwizardAppRule<ConerCoreConfiguration> buildAppRule() {
    return new DropwizardAppRule<>(
            ConerCoreApplication.class,
            ResourceHelpers.resourceFilePath("config/test.yml")
    );
}
项目:dropwizard-entitymanager    文件:AbstractIntegrationTest.java   
protected void setup(Class<? extends Application<TestConfiguration>> applicationClass) {
    dropwizardTestSupport = new DropwizardTestSupport<>(applicationClass, ResourceHelpers.resourceFilePath("integration-test.yaml"),
            ConfigOverride.config("dataSource.url", "jdbc:hsqldb:mem:DbTest" + System.nanoTime() + "?hsqldb.translate_dti_types=false"));
    dropwizardTestSupport.before();
}
项目:coner-core    文件:IntegrationTestUtils.java   
public static DropwizardAppRule<ConerCoreConfiguration> buildAppRule() {
    return new DropwizardAppRule<>(
            ConerCoreApplication.class,
            ResourceHelpers.resourceFilePath("config/test.yml")
    );
}
项目:dropwizard-vaadin    文件:VaadinApplicationStarter.java   
public static void main(String... args) throws Exception {
    VaadinApplication.main("server", ResourceHelpers.resourceFilePath("dummy.yaml"));
}