integration-testing

Integration tests with spring-security and ldap

时间秒杀一切 提交于 2019-12-01 04:07:01
问题 Spring embedded ldap server in unit tests is similar, however no answer was given that suites me. I can run my integration tests with spring and the embedded ldap server of spring-security without any problems. However, I haven't find a way yet to clear the embedded ldap server and load the ldif again to provide a common test environment. LdapTestUtils of spring-ldap provides a cleanAndSetup() method. However, this does not work with the suggested version (1.5.5) of apache-ds, as

ASP.Net Core Integration Testing

狂风中的少年 提交于 2019-12-01 03:44:02
问题 I'm struggling to get any sort of integration tests working with ASP.Net Core RC2. I have created a basic web project which runs fine in the browser showing the default page as expected. I then added a new class (in the same project) with the following test code: [TestClass] public class HomeControllerTests { private HttpClient client; [TestInitialize] public void Initialize() { // Arrange var host = new WebHostBuilder() .UseEnvironment("Development") .UseKestrel() .UseContentRoot(Directory

How do I get my Spring-JUnit test to think its running in a GenericApplicationContext?

别说谁变了你拦得住时间么 提交于 2019-12-01 03:35:28
I’m using Spring 3.2.6.RELEASE , JUnit 4.11 , and DWR 3.0.0-rc2 . My question is, when running a Spring-JUnit integration test, how can I simulate things being run in a org.springframework.context.support.GenericApplicationContext ? I tried this: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ "classpath:test-context.xml", "classpath:dwr-context.xml" }) @WebAppConfiguration public class MyServiceIT {} in which my “dwr-context.xml” file is set to be <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www

Protractor does not find chromedriver: The driver executable does not exist:

一个人想着一个人 提交于 2019-12-01 03:08:59
问题 I am trying to get Protractor up and running following the official Getting Started Guide. The command webdriver-manager start seems to run smoothly: webdriver-manager start seleniumProcess.pid: 22169 Apr 23, 2014 10:27:46 AM org.openqa.grid.selenium.GridLauncher main INFO: Launching a standalone server Setting system property webdriver.chrome.driver to /usr/local/lib/node_modules/protractor/selenium/chromedriver 10:27:46.959 INFO - Java: Apple Inc. 20.65-b04-462 10:27:46.960 INFO - OS: Mac

how to test react-select with react-testing-library

蓝咒 提交于 2019-12-01 02:45:17
问题 App.js import React, { Component } from "react"; import Select from "react-select"; const SELECT_OPTIONS = ["FOO", "BAR"].map(e => { return { value: e, label: e }; }); class App extends Component { state = { selected: SELECT_OPTIONS[0].value }; handleSelectChange = e => { this.setState({ selected: e.value }); }; render() { const { selected } = this.state; const value = { value: selected, label: selected }; return ( <div className="App"> <div data-testid="select"> <Select multi={false} value=

spring-data-rest integration test fails with simple json request

做~自己de王妃 提交于 2019-12-01 02:43:42
My spring-data-rest integration test fails for a simple json request. Consider the below jpa models Order.java public class Order { @Id @GeneratedValue// private Long id; @ManyToOne(fetch = FetchType.LAZY)// private Person creator; private String type; public Order(Person creator) { this.creator = creator; } // getters and setters } Person.java ic class Person { @Id @GeneratedValue private Long id; @Description("A person's first name") // private String firstName; @Description("A person's last name") // private String lastName; @Description("A person's siblings") // @ManyToMany // private List

How to reuse test code in imported package? [duplicate]

谁都会走 提交于 2019-12-01 02:27:19
问题 This question already has an answer here : Can I create shared test utilities? (1 answer) Closed 2 months ago . Here is my directory hierarchy: / |-- main.go // package main, an HTTP server which accepts request and calls C/U APIs in pkg1 to finish certain task |-- main_test.go // wants to call veryfyTaskNumber in pkg1_test |-- pkg1 // package pkg1, CRUD APIs with Retrieve&Delete unexported for safety |-- pkg1_test.go // contains a function verifyTaskNumber(*testing.T, taskName string,

How do I include test classes and configuration in my war for integration testing using maven?

て烟熏妆下的殇ゞ 提交于 2019-12-01 00:29:04
问题 I currently have a maven web project that I am attempting to write integration tests for. For the structure of the project, I've defined test stubs under src/test/java , whilst the spring bean definitions for these stubs sit under src/test/resources . What I would like to do, is that when I build my war artifact I'd like all of the test stub classes to be compiled and included in the war along with the spring bean definition files. I've tried to do it with the maven war plugin but the only

Java Jar hell Runtime Exception

走远了吗. 提交于 2019-11-30 23:49:29
I am facing the issue with jar hell while running the unit test. java.lang.RuntimeException: found jar hell in test classpath at org.elasticsearch.bootstrap.BootstrapForTesting.<clinit>(BootstrapForTesting.java:95) at org.elasticsearch.test.ESTestCase.<clinit>(ESTestCase.java:99) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:585) Caused by: java.lang.IllegalStateException: jar hell! class: org.apache.commons.io.CopyUtils jar1: C:\Users\vvenkatasubbu\.gradle\caches\modules

spring-data-rest integration test fails with simple json request

我只是一个虾纸丫 提交于 2019-11-30 22:28:09
问题 My spring-data-rest integration test fails for a simple json request. Consider the below jpa models Order.java public class Order { @Id @GeneratedValue// private Long id; @ManyToOne(fetch = FetchType.LAZY)// private Person creator; private String type; public Order(Person creator) { this.creator = creator; } // getters and setters } Person.java ic class Person { @Id @GeneratedValue private Long id; @Description("A person's first name") // private String firstName; @Description("A person's