jcabi / jcabi/jcabi-github

Fix logic in RtForkTest.patchAndCheckJsonFork()

Open
#1,226 7 comments 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

In [this](https://github.com/jcabi/jcabi-github/blob/master/src/test/java/com/jcabi/github/RtForkTest.java) test a `fork` is created, patched and some assertions are made.
The test works fine, but the mocks are done illogically, making the test (and thus relation between fork and repo) hard to understand:

There are 2 mock servers started: `container` and `forksContainer`. The created `repo` comes from `forksContainer`, while the created `fork` comes from `container`. This does not make sense, they should both come from the same server, at least for test simplicity.

Furthermore, with the current setup, if you try to `iterate` over the created `repo`'s forks, you get an exception, since `forksContainer` does not know to return the `fork`.

The test works just fine and the logic is much simpler if we just use `container` for both the `repo` and the `fork` and get rid of `forkContainer`.

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.