@Test public void testValidation() { when(mode.isIssues()).thenReturn(true); when(loader.load(eq("key"), eq(true), any())).thenReturn(project); provider.provide(loader, props, mode, branchConfiguration); }
@Test public void testAssociated() { when(mode.isIssues()).thenReturn(false); when(loader.load(eq("key"), eq(false), any())).thenReturn(project); ProjectRepositories repo = provider.provide(loader, props, mode, branchConfiguration); assertThat(repo.exists()).isEqualTo(true); assertThat(repo.lastAnalysisDate()).isNotNull(); verify(mode, times(1)).isIssues(); verify(props).getKeyWithBranch(); verify(loader).load(eq("key"), eq(false), eq(null)); verifyNoMoreInteractions(loader, props, mode); } }