ServerClient extends AuthenticatedSdkHttpClient { public ServerCredentials getServerCredentials(String serverId) { return client(SERVER_URL_WITH_ID + "/credentials") .resolveTemplate(SERVER_ID, serverId) .request() .get(ServerCredentials.class); } ServerClient(BearerAuthentication authFilter, SdkConfiguration config); BaseServerResponse create(CreateServerRequest request); BaseServerResponse clone(CloneServerRequest request); BaseServerResponse importServer(ImportServerRequest request); BaseServerResponse delete(String serverId); ServerMetadata findServerByUuid(String uuid); ServerMetadata findServerById(String id); Link modify(String serverId, List<ModifyServerRequest> request); GroupMetadata getGroup(String rootGroupId, boolean includeServerDetails); GroupMetadata createGroup(CreateGroupRequest createGroupRequest); boolean updateGroup(String groupId, UpdateGroupRequest updateGroupRequest); Link deleteGroup(String groupId); BaseServerListResponse powerOn(List<String> serverIdList); BaseServerListResponse powerOff(List<String> serverIdList); BaseServerListResponse startMaintenance(List<String> serverIdList); BaseServerListResponse stopMaintenance(List<String> serverIdList); BaseServerListResponse pause(List<String> serverIdList); BaseServerListResponse reboot(List<String> serverIdList); BaseServerListResponse reset(List<String> serverIdList); BaseServerListResponse shutDown(List<String> serverIdList); BaseServerListResponse archive(List<String> serverIdList); BaseServerListResponse createSnapshot(CreateSnapshotRequest request); Link deleteSnapshot(String serverId, String snapshotId); Link revertToSnapshot(String serverId, String snapshotId); Link restore(String serverId, RestoreServerRequest request); ClientBillingStats getGroupBillingStats(String groupId); List<ServerMonitoringStatistics> getMonitoringStatistics(String groupId, MonitoringStatisticRequest request); Link addPublicIp(String serverId, PublicIpRequest publicIpRequest); PublicIpMetadata getPublicIp(String serverId, String publicIp); Link modifyPublicIp(String serverId, String publicIp, PublicIpRequest publicIpRequest); Link removePublicIp(String serverId, String publicIp); ServerCredentials getServerCredentials(String serverId); List<CustomFieldMetadata> getCustomFields(); InvoiceData getInvoice(int year, int month, String pricingAccountAlias); List<NetworkMetadata> getNetworks(String dataCenter); NetworkMetadata getNetwork(String networkId, String dataCenterId, String ipAddressesDetails); NetworkLink addSecondaryNetwork(String serverId, AddNetworkRequest networkRequest); NetworkLink removeSecondaryNetwork(String serverId, String networkId);  }
@Test(groups = {INTEGRATION, LONG_RUNNING}) public void getServerCredentialsTest() { ServerMetadata server = serverService.findByRef(SingleServerFixture.server()); ServerCredentials credentials = serverClient.getServerCredentials(server.getName()); assertNotNull(credentials); assertNotNull(credentials.getPassword()); assertNotNull(credentials.getUserName()); assertFalse(credentials.getPassword().isEmpty()); assertFalse(credentials.getUserName().isEmpty()); }