@SuppressWarnings("unchecked")
@Test
public void testGetAvailableScopes() {

    Request wrappedRequest = createMockRequest();
    Map<String, Object> context = createMock(Map.class);
    RequestWrapper request = createRequestWrapper(wrappedRequest);
    String[] scopes = new String[] {"one", "two", "three"};
    expect(wrappedRequest.getAvailableScopes()).andReturn(Arrays.asList(scopes));
    replay(wrappedRequest, context);
    assertArrayEquals(scopes, request.getAvailableScopes().toArray());
    verify(wrappedRequest, context);
}