I would agree with Laurent, and we have faced a very similar situation. Our team tests the APIs for data transport and parsing. The developer unit/component level tests were all against mock objects and data stores.
Unit tests are not always comprehensive so we built a 'fake server' to emulate various web services that we used for running additional ...
I've read "Foundations of Software Testing: ISTQB Certification" by Dorothy Graham et al. For each chapter of Syllabus it has sample example questions, together with correct answers and reference to the paragraph explaining why it is correct.
On ISTQB site there is is also a free sample of exam questions and correct answers but without explanation why it is ...
I think "acceptance tests" and "mocking services layers" don't go along. My feeling is that when you do acceptance/functional testing, then you run your whole system in a manner close to the way it will be used although you try to do it in a QA/preprod environment to be confident of the state of your system. If, for the reasons you mention, you can not do ...
I think the same scenario could happen even if class A uses class B but does not contain class B.
One way to mitigate that risk is to write unit tests for class B that validate the assumptions embedded in your mock.
Copying from the linked issue, you could override type to always return 1 when asked about git.
functions --copy type builtin_type
function type # mock
if test "x$argv" = "x-fq git"
builtin_type $argv # call original
This should work across a variety of environments, and not depend on where git is installed, nor ...
How can I using java and something like rest-assured test this API? can I some how mock it to test or do I need to write my automation code in c# in order to do this?
The same way you would with a Java application except it wouldn't be during deploy. The underlying language of the application shouldn't make a difference.
Should I deploy the API on to a ...
Some good practice paper you will find here on istqbexamcertification.
Main thing is to concentrate on syllabus given by ISTQB.
As per my experience only some time questions come from practice paper in real exam. Paper is always based in ISTQB syllabus. So read , understand and remember each and every line of it.
You could update the $PATH so that git isn't in it, and then restore it afterwards.
However, this will be risky, as it means you'd either need to assume that git is installed somewhere, and just remove that from the path, or determine programmatically where it's located, and remove the path. And then you'd have to worry about it being installed in ...
While there's not a lot of details, the unittest.mock library should handle this for you? I think this is what you mean when you say "I know I can set a sequence of return values, but this is limited to a single method"
As for future-proofing, if you're trying to test A in isolation, you're verifying that A works with the contracts to B and C not changing. ...
Mocking some endpoint is a must when your application connect to other host which you can't manage all the time , (Eg. third party api to send sms or email)
Because sometimes the endpoint do a weekly maintenance or make a change without you knowing it.
Also as a QA you want to do a negative case and you want the endpoint give you specific result that ...
Depends on what your resources are you might want to use either online service like
or https://get.mocklab.io/ (that is build on top of wiremock)
or any other service like there ones
or you might install
or Wiremock that you have already mentioned.
When you use online ...
To test something like this you want your test to not care whether it's connecting to the actual remote database or to a mock database that you manage yourself. It can be an actual, if lightweight, database or a coded representation of one. As long as the class you want to test does not use hard-coded values to connect, you should be able to do this.
It should be realtively easy to setup a server that behaves as your API, but always returns the same values so you can test against it.
You just need to make sure you can redirect the traffic from your mobile app to this server. Simplest way is to make it configurable in the app itself. Alternately you can point the production hostname to your test server.
I had used browsermob-proxy and its Python client successfully in one of my project by using rewrite url to load mocking content. browsermob-proxy is a proxy server for the browser to connect with during testing.
Assume you are hosting a webserver with mock content on localhost:8899, below example will load the mock content whenever the browser try to load ...
In Selenium features the server and client are running in separate processes. Therefore when mocking time with a tool like Timecop, the browser controlled by Selenium will still see the unmocked system time.
Simple case: Synchronizing the client’s time with the mocked server’s time
= render "layouts/sinon" # the card attached partial
Yes, you can verify daoInterface.insert is called with verify(daoInterface).insert(anyObject());, but you have to mock DaoInterface first with DaoInterface db = mock(DaoInterface.class);. verify(daoInterface).insert(entity); will fail all the time because entity object from verify's argument and entity inside serviceMessage() are different instance. Instead, ...
This is a lot of questions that you might consider splitting up, but here goes:
Dependency issue - why is this a problem for unit-testing in Android?
Really, this is as much of a problem for Android as it is for anything else. Depending on how you architect your application, isolating from dependencies can easy or hard. There's nothing in your getName ...
The first question I would ask myself if I were you: do I have to test how third-party application works (e.g. Does the set of answers lead to an expected data in a csv file?) or do I assume that third-party app works fine and I just need to test integration between my application and third-party (e.g. Is a new csv file added to a shared sftp location gets ...
You have a few options here.
Given that your system sends data to the third party system, you either know the format or can get the format of the data to send from your programming team. You know the format of the data returned. This is enough to build a simple simulator that will generate dummy data in the appropriate format given the input. ...