@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"))); }
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; }
public SamlEngineAppRule(boolean isCountryEnabled, ConfigOverride... configOverrides) { super(SamlEngineIntegrationApplication.class, ResourceHelpers.resourceFilePath("saml-engine.yml"), withDefaultOverrides(isCountryEnabled, configOverrides) ); BootstrapUtils.reset(); }
public void setup( Class<? extends Application<TestConfiguration>> applicationClass, String configPath, ConfigOverride... configOverrides) { dropwizardTestSupport = new DropwizardTestSupport<>(applicationClass, ResourceHelpers.resourceFilePath(configPath), configOverrides); dropwizardTestSupport.before(); }
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); }
@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")); }
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()); } } ); }
public SamlProxyAppRule(boolean isCountryEnabled, ConfigOverride... configOverrides) { super(SamlProxyApplication.class, ResourceHelpers.resourceFilePath("saml-proxy.yml"), withDefaultOverrides(isCountryEnabled, configOverrides) ); }
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); }
public ConfigAppRule(ConfigOverride... configOverrides) { super(ConfigApplication.class, ResourceHelpers.resourceFilePath("config.yml"), withDefaultOverrides(configOverrides) ); }
public MatchingServiceAdapterAppRule(boolean isCountryEnabled, ConfigOverride... otherConfigOverrides) { super(MatchingServiceAdapterApplication.class, ResourceHelpers.resourceFilePath("verify-matching-service-adapter.yml"), MatchingServiceAdapterAppRule.withDefaultOverrides(isCountryEnabled, otherConfigOverrides) ); }
public static DropwizardAppRule<ConerCoreConfiguration> buildAppRule() { return new DropwizardAppRule<>( ConerCoreApplication.class, ResourceHelpers.resourceFilePath("config/test.yml") ); }
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(); }
public static void main(String... args) throws Exception { VaadinApplication.main("server", ResourceHelpers.resourceFilePath("dummy.yaml")); }