<commit_before>package de.passau.uni.sec.compose.pdp.servioticy.idm;

import static org.junit.Assert.fail;

import java.io.IOException;
import java.util.UUID;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.util.EntityUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import de.passau.uni.sec.compose.pdp.servioticy.exception.PDPServioticyException;

public class TestIDMCommunicator 
{
	 private IDMCommunicator com;
	//replace this for a valid token when running the test
	 private String access_token_user = "<KEY>";
	 
	 @Before
	 public void setUp()
	 {
		  com = new IDMCommunicator("composecontroller", "composecontrollerpassword", "localhost", 8080);
	 }
	 
	 //@Test
	 public void getDataFromUserToken()
	 {
		 
		 try{
			 
			 
			 String response = com.getInformationForUser(access_token_user);
			 System.out.println(response);
		 }
		 catch(PDPServioticyException e)
		 {
			 //TODO handle:
			 fail();
			 System.out.println("User message: "+e.getMessage()+" Status: "+e.getStatus()+" Logging info: "+e.getLogInfo());
		 }

	 }
	 
	 @Test
	 public void deleteSO() 
	 {
		 try{
			 //add the bearer key word.
			 access_token_user = "Bearer <PASSWORD>Token";
			 com.deleteSO("http", "localhost", 8080, "so1meid",access_token_user);
			
		 }
		 catch(PDPServioticyException e)
		 {<commit_msg>Leave tests using networking out.<commit_after>package de.passau.uni.sec.compose.pdp.servioticy.idm;

import static org.junit.Assert.fail;

import java.io.IOException;
import java.util.UUID;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.util.EntityUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import de.passau.uni.sec.compose.pdp.servioticy.exception.PDPServioticyException;

public class TestIDMCommunicator 
{
	 private IDMCommunicator com;
	//replace this for a valid token when running the test
	 private String access_token_user = "<KEY>";
	 
	 @Before
	 public void setUp()
	 {
		  com = new IDMCommunicator("composecontroller", "composecontrollerpassword", "<PASSWORD>", 8080);
	 }
	 
	 //@Test
	 public void getDataFromUserToken()
	 {
		 
		 try{
			 
			 
			 String response = com.getInformationForUser(access_token_user);
			 System.out.println(response);
		 }
		 catch(PDPServioticyException e)
		 {
			 //TODO handle:
			 fail();
			 System.out.println("User message: "+e.getMessage()+" Status: "+e.getStatus()+" Logging info: "+e.getLogInfo());
		 }

	 }
	 
	 //@Test
	 public void deleteSO() 
	 {
		 try{
			 //add the bearer key word.
			 access_token_user = "Bearer anonymousToken";
			 com.deleteSO("http", "localhost", 8080, "so1meid",access_token_user);
			
		 }
		 catch(PDPServioticyException e)
		 {
{'fraction_non_alphanumeric': 0.11739130434782609, 'fraction_numerical': 0.0052173913043478265, 'mean_word_length': 4.197289156626506, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7324727', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1045, 'n_words': 216}