alibaba / alibaba/testable-mock

一个被测试类可以有个多个Mock类吗?

Open
#333 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.8k
Forks
306
PR merge metrics
No merged PRs in 30d

Description

在写单测的时候,一个被测试类可能被多个业务使用,每个业务对被测试类要求的返回结果不同。如果都通过MOCK_CONTEXT区分业务来源的话,那么这个Mock里的方法将会很冗余。

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no file or test; begin by tracing how MOCK_CONTEXT selects business-specific behavior and reviewing the existing mock-class conventions. Done means the supported behavior for multiple Mock classes is clearly defined and verified without redundant business-specific methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.