jcabi / jcabi-github

Java Object-Oriented Wrapper of GitHub API, with a fake implementation of the entire GitHub API (for your tests)
https://github.jcabi.com
Other
306 stars 142 forks source link

Fix logic in RtForkTest.patchAndCheckJsonFork() #1226

Open amihaiemil opened 8 years ago

amihaiemil commented 8 years ago

In this 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.

amihaiemil commented 8 years ago

@dmarkov Can you see about this one pls?

dmarkov commented 8 years ago

@yegor256 please do something about it, see par.21

amihaiemil commented 8 years ago

@yegor256 can you have a look here pls? Thanks

amihaiemil commented 8 years ago

@yegor256 ping

amihaiemil commented 8 years ago

@yegor256 Don't forget about this pls

amihaiemil commented 8 years ago

@yegor256 ping

dmarkov commented 8 years ago

@amihaiemil thanks for the ticket, your account was topped for 15 mins, payment AP-9NT580487T283314A