Unresolved reference: testing

According to official google documentation we should add our test helpers for Architecture Components (LiveData) in a such way: // Test helpers for LiveData testImplementation “android.arch.core:core-testing:1.1.0” And at least for me it just doesn’t work. (see the question above) How it should be actually: // Test helpers for LiveData androidTestImplementation “android.arch.core:core-testing:1.1.0” Now everything works just … Read more

JUnit test report enrichment with JavaDoc

One way to achieve this would be to use a custom RunListener, with the caveat that it would be easier to use an annotation rather than javadoc. You would need to have a custom annotation such as: @TestDoc(text=”tests for XXX-342, fixes customer issue blahblah”) @Test public void testForReallyBigThings() { // stuff } RunListener listens to … Read more

Should e2e tests persist data in real databases?

I’m currently working at a large well-known company on our test tools and frameworks team. So while I’m no expert, it is something that’s part of my job. I’m going to be talking specifically about web testing. Testing is somewhat different for native apps like iOS and Android and I’m not super familiar with those … Read more

Add Header Value For Spring TestRestTemplate Integration Test

Update: As of Spring Boot 1.4.0, TestRestTemplate does not extend RestTemplate anymore but still provides the same API as RestTemplate. TestRestTemplate extends RestTemplate provides the same API as the RestTemplate, so you can use that same API for sending requests. For example: HttpHeaders headers = new HttpHeaders(); headers.add(“your_header”, “its_value”); template.exchange(base, HttpMethod.GET, new HttpEntity<>(headers), Page.class);

How to mock request and response in nodejs to test middleware/controllers?

There’s a semi decent implementation at node-mocks-http Require it: var mocks = require(‘node-mocks-http’); you can then compose req and response objects: req = mocks.createRequest(); res = mocks.createResponse(); You can then test your controller directly: var demoController = require(‘demoController’); demoController.login(req, res); assert.equal(res.json, {}) caveat There is at time of writing an issue in this implementation to … Read more