<commit_before>package org.joyrest.ittest.setup;

import java.util.Date;

import org.joyrest.ittest.config.Application;
import org.joyrest.ittest.entity.FeedEntry;
import org.joyrest.logging.JoyLogger;
import org.junit.*;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.*;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
import org.springframework.test.context.web.WebAppConfiguration;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jayway.restassured.RestAssured;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
@IntegrationTest("server.port=0")
@TestExecutionListeners(listeners = {
		IntegrationTestPropertiesListener.class,
		DependencyInjectionTestExecutionListener.class })
public abstract class AbstractBasicIT {

	private static JoyLogger log = new JoyLogger(AbstractBasicIT.class);

	public static final ObjectMapper mapper = new ObjectMapper();
	public static String feedEntity = null;

	@Value("${local.server.port}")
	protected int port;

	@Rule
	public TestName name = new TestName();

	@BeforeClass
	public static void initClass() throws JsonProcessingException {
		FeedEntry f = new FeedEntry();
		f.setLink("http://localhost:8080");
		f.setPublishDate(new Date());
		f.setTitle("My Feed Title");
		f.setDescription("My Feed Description");
		feedEntity = mapper.writeValueAsString(f);
	}

	@Before
	public void setUp() {
		RestAssured.port = port;

		log.debug(() ->
			"\n ------------------------------------------------------ \n " +
					"# Run test: " + name.getMethodName() +
					"\n ------------------------------------------------------");
	}

}<commit_msg>optimized abstract IT test<commit_after>package org.joyrest.ittest.setup;

import java.util.Date;

import org.joyrest.ittest.config.Application;
import org.joyrest.ittest.entity.FeedEntry;
import org.joyrest.logging.JoyLogger;
import org.junit.*;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.*;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
import org.springframework.test.context.web.WebAppConfiguration;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jayway.restassured.RestAssured;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
@IntegrationTest("server.port=0")
@TestExecutionListeners(listeners = {
		IntegrationTestPropertiesListener.class,
		DependencyInjectionTestExecutionListener.class })
public abstract class AbstractBasicIT {

	private static JoyLogger log = new JoyLogger(AbstractBasicIT.class);

	public static final ObjectMapper mapper = new ObjectMapper();
	public static String feedEntity = null;

	@Value("${local.server.port}")
	protected int port;

	@Rule
	public TestName name = new TestName();

	static {
		try {
			FeedEntry f = new FeedEntry();
			f.setLink("http://localhost:8080");
			f.setPublishDate(new Date());
			f.setTitle("My Feed Title");
			f.setDescription("My Feed Description");
			feedEntity = mapper.writeValueAsString(f);
		} catch (JsonProcessingException e) {
			throw new RuntimeException("An error occurred during parsing the testing FeedEntry entity.");
		}
	}

	@Before
	public void setUp() {
		RestAssured.port = port;

		log.debug(() ->
			"\n ------------------------------------------------------ \n " +
			"# Run test: " + name.getMethodName() +
			"\n ------------------------------------------------------");
	}

}
{'fraction_non_alphanumeric': 0.14882618996338573, 'fraction_numerical': 0.0034460478139134183, 'mean_word_length': 4.5285714285714285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4557571', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1239, 'n_words': 242}