integration-testing

Spring MockRestServiceServer handling multiple requests to the same URI (auto-discovery)

守給你的承諾、 提交于 2019-11-30 13:44:16
问题 Let's say I am writing Spring integration tests for a REST service A. This service in turn hits another REST service B and gets a list of URIs to hit on REST service C. It is kind of auto-discovery pattern. I want to mock B and C responses using MockRestServiceServer. Now the response from B is a list of URIs, they are all very similar, and for the sake of the example lets say my response from B is like so: { uris: ["/stuff/1.json", "/stuff/2.json", "/stuff/39.json", "/stuff/47.json"] }

Adding an additional test suite to Gradle

吃可爱长大的小学妹 提交于 2019-11-30 12:32:26
I am attempting to add Gradle (1.4) to an existing project that has multiple test suites. The standard unit test located in src/test/java ran successfully, but I am having trouble setting up a task to run the JUnit test located in src/integration-test/java . When I run gradle intTest I get several cannot find symbol errors for classes in src/main . This leads me to believe that the dependencies are not set up correctly. How do I setup intTest so that it will run my JUnit integration tests? build.gradle apply plugin: 'java' sourceCompatibility = JavaVersion.VERSION_1_6 sourceSets { integration

How do I run Rails integration tests without dropping DB contents?

帅比萌擦擦* 提交于 2019-11-30 12:18:54
I've written some integration tests that I'd like to run against a copy of my prod database before I push to production. This lets me test all of my routes are still correct, all of the pages render without errors and some of the multipage workflows work as expected. When I run the integration tests it drops the database I've loaded and loads the test fixtures (as expected). How can I change this behaviour and keep the copy of my production DB I've loaded? Integration tests calls db:test:prepare which calls db:test:clone_structure which calls db:structure:dump and db:test:purge You can write

How to instantiate different versions of InternetExplorerDriver - Selenium 2?

巧了我就是萌 提交于 2019-11-30 12:14:13
just wondering how I can instantiate different versions of InternetExplorerDriver. That's how I can create a IE driver: WebDriver ieWebDriver = new InternetExplorerDriver(); but I am not able to differentiate between IE6, IE7, IE8 and IE9. Cheers, Windows only supports installing a single IE version. Although some hacks exist to run multiple versions, I'm pretty sure you won't get them working with WebDriver (although I'd love to be proven wrong). In your shoes, I would probably set up a Windows VM for each version you want to test and use RemoteWebDriver to talk to them. Yes, you can.

ActivityTestRule - how to call code before Application's onCreate

徘徊边缘 提交于 2019-11-30 11:42:52
I am using Espresso 2.1 with ActivityTestRule, and I am looking for a way to set some static flags before onCreate() in my application will be called. I have some init code that I don't want called during instrumentation tests. Application onCreate() is called after Instrumentation onCreate() . For this case you need to implement a custom test runner which will subclass AndroidJUnitRunner and will override the callApplicationOnCreate() with your custom setup. public class MyCustomTestRunner extends AndroidJUnitRunner { @Override public void callApplicationOnCreate(Application app) {

Integration Testing for a Web App

十年热恋 提交于 2019-11-30 11:41:05
问题 I want to do full integration testing for a web application. I want to test many things like AJAX, positioning and presence of certain phrases and HTML elements using several browsers . I'm seeking a tool to do such automated testing. On the other hand; this is my first time using integration testing. Are there any specific recommendations when doing such testing? Any tutorial as well? (As a note: My backend code is done using Perl, Python and Django.) Thanks! 回答1: If you need to do full

In Maven is it possible to keep integration tests in a separate folder from unit tests?

只愿长相守 提交于 2019-11-30 10:57:36
On the Maven and Integration Testing page it says: The Future Rumor has it that a future version of Maven will support something like src/it/java in the integration-test phase, in addition to src/test/java in the test phase. but that was back in 2011-12-11. Has this happened yet? In this answer to "Run maven test not in default src/test/java folder" it mentions setting the <testSourceDirectory> , is their some way of doing this just for integration test (ie. the integration-test phase)? I'm looking to use the Maven FailSafe plugin and avoid renaming a bunch of integration tests or using the

Maven separate Unit Test and Integration Tests

两盒软妹~` 提交于 2019-11-30 10:47:17
问题 UT = Unit Tests IT = Integration Tests. All my Integration test classes are annotated with @Category(IntegrationTest.class) My goal is: mvn clean install => runs UT and not IT mvn clean install -DskipTests=true => no tests are executed mvn clean deploy => runs UT and not IT mvn clean test => runs UT and not IT mvn clean verify => runs UT and IT mvn clean integration-test => runs IT and UT are not executed mvn clean install deploy => runs UT and not IT pom properties: <junit.version>4.12<

Starting external process during integration testing in maven

点点圈 提交于 2019-11-30 10:29:24
I want completely automated integration testing for a Maven project. The integration tests require that an external (platform-dependent) program is started before running. Ideally, the external program would be killed after the unit tests are finished, but is not necessary. Is there a Maven plugin to accomplish this? Other ideas? sblundy You could use the antrun plugin. Inside you would use ant's exec apply task. Something like this. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.2</version> <executions> <execution> <phase> <!-- a

CakePHP 3.4.2 Testing POST's response always returning NULL

♀尐吖头ヾ 提交于 2019-11-30 09:56:50
问题 i'm currently testing an app that simply searches a record by the given id. It works fine but the testing refuses to return the response in the code. Strangely it is ONLY shown in the CLI. I'm using phpunit provided by cakephp: "phpunit/phpunit": "^5.7|^6.0" Here is the conflicting code: $this->post('/comunas/findByBarrio',[ 'barrio_id'=>1 ]); var_dump($this->_response->body());die(); //This is just a test which always returns NULL... while the CLI shows the actual response, which is a JSON.