jcabi / jcabi/jcabi-github

Mock GitHub doesn't allow control over timestamps

Open
#1,081 1 comment 0 reactions 0 assignees View on GitHub
bug DEV
Dominant language
Java
Stars
307
Forks
144
Avg merge
1d 22h
Merged PRs (30d)
14

Description

It does not currently seem possible to control the created_at (& other) timestamps of Mock GitHub entities. This makes it annoying or impossible to use the mocks for testing code that depends on the amount of time elapsed between mocked GitHub occurrences.
My suggestion would be for `Github.Time` to take a [`Clock`](https://docs.oracle.com/javase/8/docs/api/java/time/Clock.html)-like object as a constructor parameter, and use this `Clock` instead of `new Date()` to get the "current" time.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.