griddynamics / nexus-replication-plugin

Replication plugin for Sonatype Nexus
Apache License 2.0
10 stars 5 forks source link

Automated tests #30

Open gd-tmagrys opened 9 years ago

gd-tmagrys commented 9 years ago

Implementing story:

https://github.com/griddynamics/nexus-replication-plugin/issues/16

This PR overrides:

https://github.com/griddynamics/nexus-replication-plugin/pull/24

Please review and merge if possible.

ctapobep commented 9 years ago

@gd-tmagrys the first 2 commits here are outdated, is that right?

gd-tmagrys commented 9 years ago

Yes, because this work was created on top of #29 . I'll rebase it on master.

gd-tmagrys commented 9 years ago

@ctapobep, I rebased work regarding this PR on master. Feel free to review.

ctapobep commented 9 years ago

Hm. But I see classes like JerseyClientFactory added within this commit, so it's not just tests. I haven't looked in much details at the tests, but the overall impression is still that we mock too much..

Also, couple of test design comments:

M2Repository repository = mock(M2Repository.class);
when(repository.getRemoteUrl()).thenReturn("http://localhost:8081/nexus/content/repositories/snapshots/");
when(repository.getId()).thenReturn("replica-1");
when(repository.getArtifactStoreHelper()).thenReturn(artifactStoreHelper);
repositories.add(repository);

Can be placed in method: private M2Repository repo(String id, String url). There may be couple of overloaded methods like private M2Repository repo(String id) and private M2Repository repo() that return repos with default or random IDs/URLs.

gd-tmagrys commented 9 years ago

@ctapobep, I hope that I fix things you've mentioned in my last commit.