Questions tagged [integration-testing]

A form of software testing where individual software modules (or components) are combined and tested as a group. Integration testing happens after unit testing, and before system testing.

Integration testing is a form of software testing where individual software modules (or components) are combined and tested as a group. Integration testing happens after unit testing, and before system testing.

In an integration test, all input modules are modules that have already been unit tested. These modules are grouped in larger aggregates and integration tests are applied to those aggregates. After a successful integration test, the integrated system is ready for system testing.

6972 questions
36
votes
4 answers

Should e2e tests persist data in real databases?

I've been reading a lot about e2e testing and one thing I cannot understand is how "real" should e2e tests be. Regardless of the tools I use for the e2e tests, I've seen that most of the time they hit either local, development or alpha…
36
votes
3 answers

Add Header Value For Spring TestRestTemplate Integration Test

I am using TestRestTemplate for integration testing on our product. I have one test that looks like this: @Test public void testDeviceQuery() { ResponseEntity deviceInfoPage = template.getForEntity(base, Page.class); // validation…
DavidR
  • 6,622
  • 13
  • 56
  • 70
35
votes
3 answers

Benefits of Maven FailSafe Plugin

I read Maven Failsafe plugin is designed specifically to run integration tests. Currently I'm working on a multi-module project and integration tests are in its own separate module, written in TestNg and run using Surefire plugin. We don't have…
35
votes
1 answer

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

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…
Sled
  • 18,541
  • 27
  • 119
  • 168
34
votes
4 answers

Unresolved reference: testing

I'm trying to write simple integration test in my current android project written totally in Kotlin. The problem is that the test doesn't even start and fails with the following error: Error:(4, 36) Unresolved reference: testing Error:(18, 52)…
34
votes
9 answers

Problem using SQLite :memory: with NHibernate

I use NHibernate for my dataacess, and for awhile not I've been using SQLite for local integration tests. I've been using a file, but I thought I would out the :memory: option. When I fire up any of the integration tests, the database seems to be…
Chris Canal
  • 4,824
  • 9
  • 35
  • 45
33
votes
3 answers

@SpringBootTest vs @ContextConfiguration vs @Import in Spring Boot Unit Test

I'm working on a Spring Boot project. I'm writing a Unit Test code based on TDD which is a little bit difficult. @SpringBootTest loaded all beans, which led to longer test times. So I used the @SpringBootTest's class designation. I completed the…
33
votes
10 answers

Spring Boot Authentication for Integration Tests

I'm trying to run an integration test for my controller but I am running into issues if I don't authenticate. Here's my controller: @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment =…
Richard
  • 5,840
  • 36
  • 123
  • 208
32
votes
5 answers

Xcode project how to detect target programmatically or how to use env vars

I want to do an Application test that parses some json, stores to core data, and reads out some objects. How can my code know if it's being run as part of a test or normal run? Just some way to know "are we in test target"? Because the app when it…
jpswain
  • 14,642
  • 8
  • 58
  • 63
32
votes
8 answers

Integration testing ASP.NET Core with .NET Framework - can't find deps.json

I have a ASP.NET Core Web API project targeting .NET Framework 4.7 that I'm trying to write integration tests for. I created a unit test project using Visual Studio Add new project and then the Unit Test Project (.NET Framework) template. I added…
32
votes
4 answers

Spring Boot. @DataJpaTest H2 embedded database create schema

I have couple of entities in my data layer stored in particular schema. For example: @Entity @Table(name = "FOO", schema = "DUMMY") public class Foo {} I'm trying to setup H2 embedded database for integration testing of my data layer. I'm using…
31
votes
3 answers

How to perform integration testing in PHP?

I am currently performing unit tests on my code (using PHPUnit and Jenkins) but I have read a lot about integration testing. Are there any tools to perform this in php (preferably automated)? How would I go about implementing it? Are there any good…
JoshB
  • 742
  • 1
  • 8
  • 12
31
votes
9 answers

"Could not find a valid mapping for #" only on second and successive tests

I'm trying to write a request test that asserts that the proper links appear on the application layout depending in whether a user is logged in or out. FWIW, I'm using Devise for the authentication piece. Here's my spec: require…
Chris Bloom
  • 3,526
  • 1
  • 33
  • 47
31
votes
5 answers

Set dummy IP address in integration test with Asp.Net Core TestServer

I have a C# Asp.Net Core (1.x) project, implementing a web REST API, and its related integration test project, where before any test there's a setup similar to: // ... IWebHostBuilder webHostBuilder = GetWebHostBuilderSimilarToRealOne() …
superjos
  • 12,189
  • 6
  • 89
  • 134
31
votes
5 answers

How to apply integration tests to a Flask RESTful API

[As per https://stackoverflow.com/a/46369945/1021819, the title should refer to integration tests rather than unit tests] Suppose I'd like to test the following Flask API (from here): import flask import flask_restful app =…
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526