Closed TimvdLippe closed 7 years ago
Hm, it seems to be breaking on the Mockito installation. It resolves the artifact to https://devhub.ewi.tudelft.nl/nexus/content/repositories/releases/org/mockito/mockito-core/2.8.3/mockito-core-2.8.3.pom which is no maven central. Running locally works just fine. Unsure what I can do here?
The https://devhub.ewi.tudelft.nl/nexus repository falls back to maven central. Based on maven-repository.com, the latest version available on central is 2.7.22
. So it seems you're testing against a local snapshot after all? Or perhaps the artifact moved to another group id?
We can just use the silent version of the runner :) Seems like an appropriate option here
On Mon, 17 Apr 2017, 23:15 Jan-Willem Gmelig Meyling, < notifications@github.com> wrote:
@JWGmeligMeyling commented on this pull request.
In src/test/java/nl/tudelft/ewi/devhub/modules/MockedGitoliteGitServerModule.java https://github.com/devhub-tud/devhub/pull/432#discussion_r111823642:
@@ -126,7 +126,6 @@ protected void createMockedMirrorsFolder() { protected void createMockedRepositoriesFolder() { String repositoriesPath = repositoriesFolder.toPath().toString() + "/"; when(configuration.getGitoliteBaseUrl()).thenReturn(repositoriesPath);
- when(configuration.getRepositoriesDirectory()).thenReturn(repositoriesFolder);
Aha hm that's an interesting question. Because this module was never designed for mocking unit tests, it is designed to act as a git server accessed through a git client by binding some of the git server implementation to its client interfaces. I see why Mockito discourages strict stubbing for unit tests, but really Mockito was used here primarily to:
- Allow tests to spy behaviour on some of the mocked behaviour
- Not have to go through extending every single interface in the hierarchy ourself
Perhaps it's better to rewrite this module so that it doesn't use Mockito anymore? Because I can imagine future tests that use this module failing because not all stubs will be hit in every single tests (as obviously not every possible git server interaction is used in every test). What do you think?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/devhub-tud/devhub/pull/432#discussion_r111823642, or mute the thread https://github.com/notifications/unsubscribe-auth/AFrDb5nIDa_-TqTBMZQxoRfl-g-ND6shks5rw9Z_gaJpZM4M-vUx .
Perhaps because this test is only run on mvn integration-test
?
Yeah, already pushed an update. Should pass soonTM
This PR upgrades Mockito to 2.8.3. It migrates deprecated method calls, removes usage of the MockitoJUnitRule and removes unused stubbings as caught by strict stubbing.