private boolean clientExists(RestOperations client, OAuth2ProtectedResourceDetails resource) { ResponseEntity<String> response = client.getForEntity( serverRunning.getClientsUri() + "/" + resource.getClientId(), String.class); return response != null && response.getStatusCode() == HttpStatus.OK; }
private void createClient(RestOperations client, ClientDetails clientDetails) { ResponseEntity<String> response = client.postForEntity(serverRunning.getClientsUri(), clientDetails, String.class); assertEquals(HttpStatus.CREATED, response.getStatusCode()); }