use of org.eclipse.sw360.fossology.db.FossologyFingerPrintRepository in project sw360portal by sw360.
the class RealSshConnectionUtils method getTrustingJSchSessionFactory.
static JSchSessionProvider getTrustingJSchSessionFactory() {
FossologyFingerPrintRepository keyConnector = mock(FossologyFingerPrintRepository.class);
FossologyHostKeyRepository hostKeyRepository = spy(new FossologyHostKeyRepository(keyConnector));
doReturn(HostKeyRepository.OK).when(hostKeyRepository).check(anyString(), any(byte[].class));
return new JSchSessionProvider(new FossologySettings(), hostKeyRepository);
}
use of org.eclipse.sw360.fossology.db.FossologyFingerPrintRepository in project sw360portal by sw360.
the class FossologyUploaderFunctionalTest method setUpAutoTrustOnSecondTry.
private void setUpAutoTrustOnSecondTry() {
final FossologyFingerPrintRepository fossologyFingerPrintRepository = appContext.getBean(FossologyFingerPrintRepository.class);
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) throws Throwable {
final FossologyHostFingerPrint finger = (FossologyHostFingerPrint) invocation.getArguments()[0];
FossologyHostFingerPrint trustedFingerPrint = finger.deepCopy().setTrusted(true);
doReturn(ImmutableList.of(trustedFingerPrint)).when(fossologyFingerPrintRepository).getAll();
return null;
}
}).when(fossologyFingerPrintRepository).add(any(FossologyHostFingerPrint.class));
}
Aggregations