use of com.codeborne.security.digidoc.DigiDocServicePortType in project mobileid by codeborne.
the class MobileIDAuthenticatorTest method mockError.
private DigiDocServicePortType mockError(int errorCode) throws RemoteException {
DigiDocServicePortType service = mock(DigiDocServicePortType.class);
doThrow(new RemoteException(valueOf(errorCode))).when(service).mobileAuthenticate(anyString(), anyString(), eq("37255667788"), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyBoolean(), anyBoolean(), any(IntHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class));
return service;
}
use of com.codeborne.security.digidoc.DigiDocServicePortType in project mobileid by codeborne.
the class MobileIDAuthenticatorTest method mockStatus.
private DigiDocServicePortType mockStatus(final Code status) throws RemoteException {
DigiDocServicePortType service = mock(DigiDocServicePortType.class);
doAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
((StringHolder) invocation.getArguments()[2]).value = status.toString();
return null;
}
}).when(service).getMobileAuthenticateStatus(anyInt(), eq(false), any(StringHolder.class), any(StringHolder.class));
return service;
}
use of com.codeborne.security.digidoc.DigiDocServicePortType in project mobileid by codeborne.
the class MobileIDAuthenticatorTest method mockAuthentication.
private DigiDocServicePortType mockAuthentication(String result, String firstName, String lastName, String personalCode, String challenge, int sessCode) throws RemoteException {
DigiDocServicePortType service = mock(DigiDocServicePortType.class);
doAnswer((Answer<Object>) invocation -> {
((IntHolder) invocation.getArguments()[11]).value = sessCode;
((StringHolder) invocation.getArguments()[12]).value = result;
((StringHolder) invocation.getArguments()[13]).value = personalCode;
((StringHolder) invocation.getArguments()[14]).value = firstName;
((StringHolder) invocation.getArguments()[15]).value = lastName;
((StringHolder) invocation.getArguments()[19]).value = challenge;
return null;
}).when(service).mobileAuthenticate(anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyBoolean(), anyBoolean(), any(IntHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class), any(StringHolder.class));
return service;
}
Aggregations