本文整理汇总了Java中io.dropwizard.testing.ResourceHelpers类的典型用法代码示例。如果您正苦于以下问题:Java ResourceHelpers类的具体用法?Java ResourceHelpers怎么用?Java ResourceHelpers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResourceHelpers类属于io.dropwizard.testing包,在下文中一共展示了ResourceHelpers类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testH2
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
@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")));
}
示例2: startApplicationWith
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
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;
}
示例3: SamlEngineAppRule
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public SamlEngineAppRule(boolean isCountryEnabled, ConfigOverride... configOverrides) {
super(SamlEngineIntegrationApplication.class,
ResourceHelpers.resourceFilePath("saml-engine.yml"),
withDefaultOverrides(isCountryEnabled, configOverrides)
);
BootstrapUtils.reset();
}
示例4: setup
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public void setup(
Class<? extends Application<TestConfiguration>> applicationClass,
String configPath, ConfigOverride... configOverrides) {
dropwizardTestSupport = new DropwizardTestSupport<>(applicationClass,
ResourceHelpers.resourceFilePath(configPath), configOverrides);
dropwizardTestSupport.before();
}
示例5: RegisterRule
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
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);
}
示例6: loadConfigurationWithExternalPathOfFieldsResourceFile
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
@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"));
}
示例7: buildApp
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
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());
}
}
);
}
示例8: SamlProxyAppRule
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public SamlProxyAppRule(boolean isCountryEnabled, ConfigOverride... configOverrides) {
super(SamlProxyApplication.class,
ResourceHelpers.resourceFilePath("saml-proxy.yml"),
withDefaultOverrides(isCountryEnabled, configOverrides)
);
}
示例9: buildResponseFromFile
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
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);
}
示例10: ConfigAppRule
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public ConfigAppRule(ConfigOverride... configOverrides) {
super(ConfigApplication.class,
ResourceHelpers.resourceFilePath("config.yml"),
withDefaultOverrides(configOverrides)
);
}
示例11: MatchingServiceAdapterAppRule
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public MatchingServiceAdapterAppRule(boolean isCountryEnabled, ConfigOverride... otherConfigOverrides) {
super(MatchingServiceAdapterApplication.class,
ResourceHelpers.resourceFilePath("verify-matching-service-adapter.yml"),
MatchingServiceAdapterAppRule.withDefaultOverrides(isCountryEnabled, otherConfigOverrides)
);
}
示例12: buildAppRule
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public static DropwizardAppRule<ConerCoreConfiguration> buildAppRule() {
return new DropwizardAppRule<>(
ConerCoreApplication.class,
ResourceHelpers.resourceFilePath("config/test.yml")
);
}
示例13: setup
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
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();
}
示例14: main
import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public static void main(String... args) throws Exception {
VaadinApplication.main("server", ResourceHelpers.resourceFilePath("dummy.yaml"));
}