Giter Site home page Giter Site logo

lab-stubs-and-mocks's Introduction

Tutorial on mocking and stubbing

A Java project to show unit test, stub and mocking with mockito

Objectives:

We want to build an HR software.

Our team has been assigned the following tasks:

  • Given an employee's full name, we want to capitalize the name without depending on any external service.

  • How many employees are from Edmonton? There is an online service that returns a list of all employees' addresses! We need to implement a method that checks for Edmonton, and returns the list. But what if it takes too much time to return results by the service? Everytime we run our test suite, it will take a lot of time to execute because of the service round-trip (request/response) bottleneck. In addition, service may have set a rate limit on its endpoints (e.g., maximum 500 requests a month).

  • How many employees have salary > 50K? Another team is developing a service that returns list of all the salaries, but they are not done yet. How can we filter the salary if that service from other team is not completed yet? More importantly, how would we know if our filtering implementation is correct?

Acknowledgements

The original work has been done by Shaiful Chowdhury for CMPUT 402 Winter 2019 ed.

lab-stubs-and-mocks's People

Contributors

rhaeguard avatar sarah-afiya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.