// Path: jersey-oauth2-api/src/main/java/com/github/hburgmeier/jerseyoauth2/api/types/ResponseType.java
// public enum ResponseType {
// 
// 	CODE("code"),
// 	TOKEN("token");
// 	
// 	private String technicalCode;
// 
// 	ResponseType(String technicalCode)
// 	{
// 		this.technicalCode = technicalCode;
// 	}
// 	
// 	public String getTechnicalCode() {
// 		return technicalCode;
// 	}
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.scribe.model.Token;
import com.github.hburgmeier.jerseyoauth2.api.types.GrantType;
import com.github.hburgmeier.jerseyoauth2.api.types.ResponseType;
import com.github.hburgmeier.jerseyoauth2.testsuite.base.client.ClientException;
import com.github.hburgmeier.jerseyoauth2.testsuite.base.client.ResourceClient;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
	}	
	
	@Test
	public void testResourceAccess() throws ClientException
	{
		String code = authClient.authorizeClient(clientEntity, "test1 test2").getCode();
		assertNotNull(code);
		restClient.setFollowRedirects(false);
		
		ResourceClient client = new ResourceClient(clientEntity.getClientId(), GrantType.AUTHORIZATION_REQUEST, ResponseType.TOKEN);
		String authUrl = client.getAuthUrl(null);
		
		WebResource webResource = restClient.resource(authUrl);
		ClientResponse clientResponse = webResource.get(ClientResponse.class);
		assertEquals(302, clientResponse.getStatus());
		String fragment = clientResponse.getLocation().getFragment();
		assertNotNull(fragment);
		
		Token accessToken = client.parseFragment(fragment);
		client.sendTestRequestSample1(accessToken);
		
	}	
	
	@Test
	public void testAuthCodeWithImplicit() throws ClientException
	{
		String code = authClient.authorizeClient(clientEntity, "test1 test2").getCode();
		assertNotNull(code);
		restClient.setFollowRedirects(false);
		
// Path: jersey-oauth2-api/src/main/java/com/github/hburgmeier/jerseyoauth2/api/types/ResponseType.java
// public enum ResponseType {
// 
// 	CODE("code"),
// 	TOKEN("token");
// 	
// 	private String technicalCode;
// 
// 	ResponseType(String technicalCode)
// 	{
// 		this.technicalCode = technicalCode;
// 	}
// 	
// 	public String getTechnicalCode() {
// 		return technicalCode;
// 	}
// }


// Path: jersey-oauth2-testsuite-base/src/test/java/com/github/hburgmeier/jerseyoauth2/testsuite/base/ImplicitGrantTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.scribe.model.Token;
import com.github.hburgmeier.jerseyoauth2.api.types.GrantType;
import com.github.hburgmeier.jerseyoauth2.api.types.ResponseType;
import com.github.hburgmeier.jerseyoauth2.testsuite.base.client.ClientException;
import com.github.hburgmeier.jerseyoauth2.testsuite.base.client.ResourceClient;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;

	}	
	
	@Test
	public void testResourceAccess() throws ClientException
	{
		String code = authClient.authorizeClient(clientEntity, "test1 test2").getCode();
		assertNotNull(code);
		restClient.setFollowRedirects(false);
		
		ResourceClient client = new ResourceClient(clientEntity.getClientId(), GrantType.AUTHORIZATION_REQUEST, ResponseType.TOKEN);
		String authUrl = client.getAuthUrl(null);
		
		WebResource webResource = restClient.resource(authUrl);
		ClientResponse clientResponse = webResource.get(ClientResponse.class);
		assertEquals(302, clientResponse.getStatus());
		String fragment = clientResponse.getLocation().getFragment();
		assertNotNull(fragment);
		
		Token accessToken = client.parseFragment(fragment);
		client.sendTestRequestSample1(accessToken);
		
	}	
	
	@Test
	public void testAuthCodeWithImplicit() throws ClientException
	{
		String code = authClient.authorizeClient(clientEntity, "test1 test2").getCode();
		assertNotNull(code);
		restClient.setFollowRedirects(false);
		
		ResourceClient client = new ResourceClient(clientEntity.getClientId(), GrantType.AUTHORIZATION_REQUEST, ResponseType.CODE);