Wrong return type in findById method
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java, redis
- Domain
- backend-api-design
Research direction
Start at spring-session-data-redis/src/main/java/org/springframework/session/data/redis/RedisIndexedSessionRepository.java#L428 and inspect the findById(String id) declaration and its current return type. Update the public-facing type to the general Session interface, then verify that the method remains usable for mocking and that existing production behavior is unchanged.
Written by the indexing model from the issue text.
Description
In my particular case when I had to mock up this class in my tests, it's impossible to mock return type of findById(String id) method because instead of general Session interface from org.springframework.session package, we can see internal non-public implementation called RedisSession. Generally in the production code it's not a big deal - we can assign the value returned to the var of type Session. The problem is when we want to mock this method.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spring-projects/spring-session
-
status: waiting-for-triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
spring-projects/spring-session#3857 · 1 comment ·
-
status: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
spring-projects/spring-session#3477 · 2 comments · 2 reactions ·
-
in: build type: task
spring-projects/spring-session#3958 · 1 comment · 1 assignee ·
-
status: waiting-for-triage type: bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
spring-projects/spring-session#3827 · 1 comment ·
-
status: waiting-for-triage type: bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
spring-projects/spring-session#3755 · 5 comments · 1 reaction ·
All issues in spring-projects/spring-session
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100