Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mock]

Mocking and faking are ways to isolate code or components to ensure that unit tests run against the testable unit of code only without actually utilizing other components or dependencies of an application. Mocking differs from faking in that a mock can be inspected to assert the results of a test.

0
votes
0answers
8 views

High-level help desired in forming a plan of attack for testing of background “cleanup” tasks

I have written and continue to maintain a fairly complex back-end service written in Java that scrapes arbitrary web sites, involves long-running processing jobs, and includes background tasks that ...
3
votes
1answer
39 views

How to properly test an indoor map, when you're not on the site itself?

We have a indoor map app. The app is powered by both Google and Bluetooth GPS devices. How can we mock locations when using this kind of technology? What are the strategies that can be used to test ...
3
votes
2answers
33 views

How to fake executable is missing?

related: https://github.com/fish-shell/fish-shell/issues/5444 I'm in the process of testing pure theme for fish. I want to test the following conditional branch from our __pure_prompt_first_line....
2
votes
1answer
171 views

How to properly mock dependencies

My code is organized as several independent classes. Each dependency is injected by a setter, so in the end I create instances of classes B and C, set their parameters and inject them to class A. Now ...
1
vote
3answers
93 views

Advice on API Mocking Tools

I was interested in hearing peoples experiences of using mocking, specifically for API testing. Whilst I’m (fairly!) well versed in automation techniques now, I haven’t yet used this approach but ...
0
votes
1answer
31 views

How to test a class that wraps methods connect to a remote database

I wrote a class creating connection to a remote database, query and do some more actions on that. Which is the best way/ strategy to test that kind of class? I tried to mock third party functions ...
2
votes
2answers
77 views

How can I mock a c# restful webservice and test it using java?

I suppose this is more like two questions. Considering i wanted to do some automated testing of a restful web service that is written in c#. How can I using java and something like rest-assured test ...
2
votes
0answers
128 views

How to check children method has been called in jasmine test cases?

We use spyOn(this,"_new") to track a function call in jasmine. I need to check the children method call in jasmine. My code sample is given below, Sample code: function perform(option) { this....
0
votes
2answers
96 views

How to save and share the data across multiple requests under same project in SoapUI?

I am new to the SOAPUI and have created few rest mock services in it. Now I have two separate rest mock services which do not interact with each other but are under the same project in SoapUI. The ...
0
votes
1answer
39 views

TypeMock trying to mock a random method?

I've hit an issue that has stumped me. I have Specflow tests that run perfectly fine on my local machine, but fail when run in the build. The error message I get is: System.MissingMethodException: ...
1
vote
1answer
50 views

How to avoid hidden bugs caused by test doubles?

I just got the Mockito framework for Java to try out mocking with JUnit. Trying it brought me to a basic question that I am sure is obvious but I have had trouble finding any answer for, probably ...
4
votes
2answers
948 views

Android App api testing with mock

Currently, I ran into a situation where we are having constant Backend/API issues and because of the same, I can't continue with the testing. I was wondering if it is somehow possible to use a server ...
2
votes
2answers
7k views

Mocking HTTP reponses in Selenium Web Driver using Python

I am currently experimenting with the Python version of Selenium Web Driver. Using the driver has been straight forward so far but I have been struggling recently with the issue of mocking HTTP ...
7
votes
1answer
3k views

What Is the Best Way To Mock Browser Time and Time Zone in Selenium? [closed]

I like to run Webdriver tests with altered time and time zone. I see two approaches ahead: 1) Using a mocking library like SinonJS or TimeShift.js. 2) Using system libraries like libfaketime/...
0
votes
1answer
121 views

Testing Verify Method Call Without Argument In Test Class

I have a class which takes a message with payload String. The payload is then split and used to create an Entity which is passed to DAOInterface to persist. How can you test the call daoInterface....
0
votes
1answer
152 views

Android / Java Unit-Testing Clarification

While looking up for unit testing for Android applications, I came across a lot of voices over how it is difficult to test-unit an Android app. For example: Dependency issue - why is this a problem ...
9
votes
3answers
6k views

To mock or not to mock with 'Automated Acceptance Tests'

I have been reading alot about automated acceptance testing. However, I have not found any information about how to manage external dependencies. Let's say you have a web application that acts like a ...
5
votes
2answers
2k views

Mocking IVR system

I am new to automation testing and was looking for guidance on how I can mock or create a simulator for a IVR ( automated call system ). We have an application, which sends some user data to a third ...
0
votes
2answers
687 views

Recent comparisons of Java mocking frameworks?

I'm trying to find recent comparisons of Java mocking frameworks but all of the ones I've seen are quite old. Can anyone point me to something relatively recent? Thanks
0
votes
1answer
60 views

Mocking for MXUnit

I'm fairly new to Coldfusion; at my new position, we're using MXUnit for unit testing our service library, but so far we're not mocking out the database (so we're testing against live data). I want to ...
4
votes
6answers
2k views

Where can I find ISTQB Foundation mock exams with reliable answers?

Where can I find ISTQB mock exams with reliable answers? I have heard that there are a lot of sites with mock exams but they told me to be careful because some of their answers are not correct.