apache / apache/dubbo

Replace instanceof with Matchers#instanceOf in test cases

Open
#11,388 4 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 3.2
* Operating System version: ALL
* Java version: xxx

### Steps to reproduce this issue

In some test cases use instanceof, for example ExtensionTest class
![image](https://user-images.githubusercontent.com/15797831/215259230-e244fcac-c5b0-4435-89f4-067e439427da.png)
we can replace with Matchers#instanceOf

### Expected Behavior

```
MatcherAssert.assertThat(myfactory, Matchers.instanceOf(ExtensionInjector.class));
```

### Actual Behavior

Contributor guide

Open the contributing guide

Research direction

Start with the ExtensionTest class mentioned in the issue and search the test sources for instanceof assertions. Run the affected tests, and consider the work complete when the relevant test cases use Matchers.instanceOf consistently and still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.