SqoopClient { public MConnector getConnector(long cid) { if(connectors.containsKey(cid)) { return connectors.get(cid).clone(false); } retrieveConnector(cid); return connectors.get(cid).clone(false); } SqoopClient(String serverUrl); void setServerUrl(String serverUrl); void setSqoopRequests(SqoopResourceRequests requests); void clearCache(); MConnector getConnector(long cid); MConnector getConnector(String connectorName); Collection<MConnector> getConnectors(); ResourceBundle getConnectorConfigBundle(long connectorId); MDriverConfig getDriverConfig(); MDriver getDriver(); ResourceBundle getDriverConfigBundle(); MLink createLink(long connectorId); MLink createLink(String connectorName); MLink getLink(long linkId); List<MLink> getLinks(); Status saveLink(MLink link); Status updateLink(MLink link); void enableLink(long linkId, boolean enabled); void deleteLink(long linkId); MJob createJob(long fromLinkId, long toLinkId); MJob getJob(long jobId); List<MJob> getJobs(); List<MJob> getJobsByConnector(long cId); Status saveJob(MJob job); Status updateJob(MJob job); void enableJob(long jid, boolean enabled); void deleteJob(long jobId); MSubmission startJob(long jobId); MSubmission startJob(long jobId, SubmissionCallback callback, long pollTime); MSubmission stopJob(long jid); MSubmission getJobStatus(long jid); List<MSubmission> getSubmissions(); List<MSubmission> getSubmissionsForJob(long jobId); List<MRole> getRoles(); void createRole(MRole role); void dropRole(MRole role); void grantRole(List<MRole> roles, List<MPrincipal> principals); void revokeRole(List<MRole> roles, List<MPrincipal> principals); List<MRole> getRolesByPrincipal(MPrincipal principal); List<MPrincipal> getPrincipalsByRole(MRole role); void grantPrivilege(List<MPrincipal> principals, List<MPrivilege> privileges); void revokePrivilege(List<MPrincipal> principals, List<MPrivilege> privileges); List<MPrivilege> getPrivilegesByPrincipal(MPrincipal principal, MResource resource); Token<?>[] addDelegationTokens(String renewer,
                                        Credentials credentials);  }
@Test public void testGetConnector() { when(resourceRequests.readConnector(1L)).thenReturn(connectorBean(connector(1))); MConnector connector = client.getConnector(1); assertEquals(1, connector.getPersistenceId()); client.getConnectorConfigBundle(1L); verify(resourceRequests, times(1)).readConnector(1L); }