private <T extends Credentials> T getCredentials(Class<T> clazz) {
        List<T> creds = CredentialsProvider.lookupCredentials(
                clazz, Jenkins.getInstanceOrNull(), null, Collections.emptyList());
        assertEquals(1, creds.size(), "There should be only one credential");
        return creds.get(0);
    }
Integration tests for the SSH Credentials Plugin.
integrations/src/test/java/io/jenkins/plugins/casc/SSHCredentialsTest.java