use of com.googlecode.jsonrpc4j.JsonRpcClientException in project cloudbreak by hortonworks.
the class KerberosMgmtRoleComponentV1Test method testDeleteRoleIfNoLongerUsedWhenRoleDoesNotExist.
@Test
public void testDeleteRoleIfNoLongerUsedWhenRoleDoesNotExist() throws Exception {
Mockito.when(mockIpaClient.showRole(anyString())).thenThrow(new FreeIpaClientException(ERROR_MESSAGE, new JsonRpcClientException(NOT_FOUND, ERROR_MESSAGE, null)));
underTest.deleteRoleIfItIsNoLongerUsed(ROLE, mockIpaClient);
Mockito.verify(mockIpaClient, Mockito.never()).deleteRole(ROLE);
}
use of com.googlecode.jsonrpc4j.JsonRpcClientException in project cloudbreak by hortonworks.
the class UserModOperationTest method testInvokeIfEmptyModListErrorOccurs.
@Test
public void testInvokeIfEmptyModListErrorOccurs() throws FreeIpaClientException {
when(freeIpaClient.invoke(any(), anyList(), any(), any())).thenThrow(new FreeIpaClientException("error", new JsonRpcClientException(4202, "", null)));
UserModOperation.create("key", new Object(), USER_NAME).invoke(freeIpaClient);
verify(freeIpaClient).invoke(eq("user_mod"), anyList(), any(), any());
}
use of com.googlecode.jsonrpc4j.JsonRpcClientException in project iris-client by iris-connect.
the class EPSStatusClient method checkApp.
public AppInfo checkApp(String epsEndpoint) {
var methodName = epsEndpoint + "._ping";
try {
var ping = epsRpcClient.invoke(methodName, null, Ping.class);
var name = ping.serverInfo != null ? ping.serverInfo.name : messages.getMessage("StatusService.unknown_app_name");
return new AppInfo(name, ping.version);
} catch (ConnectException | SocketTimeoutException e) {
// Connection timeout
throw new EpsConnectionException(e.getMessage());
} catch (JsonRpcClientException e) {
throw new AppStatusException(e.getMessage());
} catch (Throwable t) {
throw new AppStatusInternalException(t.getMessage(), t);
}
}
Aggregations