OpenStackUtilImpl implements OpenStackUtil { public String getAbsoluteLimits(PaasManagerUser user, String region) throws OpenStackException { OpenStackAccess openStackAccess = openStackRegion.getTokenAdmin(); log.debug("tenantid " + user.getTenantId()); log.debug("token " + openStackAccess.getToken()); HttpUriRequest request = openOperationUtil.createNovaGetRequest("limits", APPLICATION_JSON, region, user.getToken(), user.getTenantId()); String response = openOperationUtil.executeNovaRequest(request); return response; } OpenStackUtilImpl(); HttpClientConnectionManager getHttpConnectionManager(); void setHttpConnectionManager(HttpClientConnectionManager httpConnectionManager); String addInterface(String idRouter, NetworkInstance net, String region, String token, String vdc); String addInterfaceToPublicRouter(PaasManagerUser user, NetworkInstance net, String region); String addRouterInterface(String routerId, String subNetId, String region, String token, String vdc); String allocateFloatingIP(String payload, String region, String token, String vdc); String getFloatingIPs(String region, String token, String vdc, String dd); void disAllocateFloatingIP(String region, String token, String vdc, String floatingIp); String assignFloatingIP(String serverId, String floatingIP, String region, String token, String vdc); String createNetwork(String payload, String region, String token, String vdc); String createRouter(RouterInstance router, String region, String token, String vdc); String createServer(String payload, String region, String token, String vdc); String createSubNet(SubNetworkInstance subNet, String region, String token, String vdc); String deleteNetwork(String networkId, String region, String token, String vdc); String deleteRouter(String routerId, String region, String token, String vdc); String deleteServer(String serverId, String region, String token, String vdc); void deleteSubNetwork(String idSubNet, String region, String vdc, String token); String getFloatingIP(PaasManagerUser user, String region); String getNetworkDetails(String networkId, String region, String token, String vdc); String getSubNetworkDetails(String subNetworkId, String region, String token, String vdc); String getNetworks(String region, String token, String vdc); String getServer(String serverId, String region, String token, String vdc); boolean existsServerForDelete(String serverId, String region, String token, String vdc); String listServers(String region, String token, String vdc); String removeInterface(RouterInstance router, String net, String region, String token, String vdc); String getAbsoluteLimits(PaasManagerUser user, String region); String listNetworks(PaasManagerUser user, String region); String listSubNetworks(PaasManagerUser user, String region); String listPorts(PaasManagerUser user, String region); String deleteInterfaceToPublicRouter(PaasManagerUser user, NetworkInstance net, String region); OpenStackRegion getOpenStackRegion(); void setOpenStackRegion(OpenStackRegion openStackRegion); void setOpenOperationUtil(OpenOperationUtil openOperationUtil); void setOpenStackConfigUtil(OpenStackConfigUtil openStackConfigUtil); String joinNetworks(NetworkInstance networkInstance, NetworkInstance networkInstance2, String token);  }
@Test public void shouldGetAbsoluteLimitsWithResponse204() throws OpenStackException, IOException { OpenStackAccess openStackAccess = new OpenStackAccess(); openStackAccess.setToken("1234567891234567989"); openStackAccess.setTenantId("08bed031f6c54c9d9b35b42aa06b51c0"); when(openStackRegion.getTokenAdmin()).thenReturn(openStackAccess); when(openOperationUtil.executeNovaRequest(any(HttpUriRequest.class))).thenReturn("ok"); String response = openStackUtil.getAbsoluteLimits(paasManagerUser, "region"); assertNotNull(response); }