@Test public void testGetAllResourceServers() throws Exception { try { resource.add(ResourceServerDataGenerator.generateResourceServerDTO(NAME)); Collection<ResourceServerDTO> result = resource.getAll(); assertEquals(1, result.size()); resource.add( ResourceServerDataGenerator.generateResourceServerDTO("rs_another_resource_server")); result = resource.getAll(); assertEquals(2, result.size()); } finally { resource.delete(NAME); resource.delete("rs_another_resource_server"); } }
public void testDeleteResourceServer() throws Exception { resource.add(ResourceServerDataGenerator.generateResourceServerDTO(NAME)); resource.delete(NAME); Collection<ResourceServerDTO> result = resource.getAll(); assertEquals(0, result.size()); }