private static final int CORRECT_REPO_ID = 1;
private static final String CORRECT_PACKAGE_NAME = "my-script.js";
private static final int CORRECT_PACKAGE_VERSION_ID = 2;
public void testCanDownloadScript() throws Exception {
RhqFacade rhqFacade = mock(RhqFacade.class);
RepoManagerRemote repoManager = mock(RepoManagerRemote.class);
ContentManagerRemote contentManager = mock(ContentManagerRemote.class);
when(rhqFacade.getProxy(RepoManagerRemote.class)).thenReturn(repoManager);
when(rhqFacade.getProxy(ContentManagerRemote.class)).thenReturn(contentManager);
when(repoManager.findReposByCriteria(any(Subject.class), any(RepoCriteria.class))).then(
new Answer<List<Repo>>() {
@Override
public List<Repo> answer(InvocationOnMock invocation) throws Throwable {