<commit_before>package eu.ydp.empiria.player.client.resources;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import eu.ydp.empiria.player.client.controller.data.DataSourceManager;
import eu.ydp.empiria.player.client.util.file.xml.XmlData;

@RunWith(MockitoJUnitRunner.class)
public class EmpiriaPathsTest {

	@Mock(answer = Answers.RETURNS_DEEP_STUBS)
	private DataSourceManager dataSourceManager;

	@InjectMocks
	private EmpiriaPaths empiriaPaths;

	@Test
	public void testGetCommonsPath() throws Exception {
		// given
		XmlData xmlData = mock(XmlData.class);
		when(dataSourceManager.getAssessmentData().getData()).thenReturn(xmlData);
		when(xmlData.getBaseURL()).thenReturn("http://url/test");

		// when
		String commonsPath = empiriaPaths.getCommonsPath();

		// then
		verify(dataSourceManager.getAssessmentData(), never()).getSkinData(); // skin specific data
		assertThat(commonsPath, is("http://url/test/common"));
	}
}<commit_msg>More tests. YPUB-5508<commit_after>package eu.ydp.empiria.player.client.resources;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import eu.ydp.empiria.player.client.controller.data.DataSourceManager;
import eu.ydp.empiria.player.client.util.file.xml.XmlData;

@RunWith(MockitoJUnitRunner.class)
public class EmpiriaPathsTest {

	@Mock(answer = Answers.RETURNS_DEEP_STUBS)
	private DataSourceManager dataSourceManager;

	@InjectMocks
	private EmpiriaPaths empiriaPaths;

	@Test
	public void testGetCommonsPath() throws Exception {
		// given
		XmlData xmlData = mock(XmlData.class);
		when(dataSourceManager.getAssessmentData().getData()).thenReturn(xmlData);
		when(xmlData.getBaseURL()).thenReturn("http://url/test");

		// when
		String commonsPath = empiriaPaths.getCommonsPath();

		// then
		verify(dataSourceManager.getAssessmentData()).getData();
		verify(dataSourceManager.getAssessmentData(), never()).getSkinData(); // skin specific data
		assertThat(commonsPath, is("http://url/test/common"));
	}
}
{'fraction_non_alphanumeric': 0.11950599346167817, 'fraction_numerical': 0.001452960406828914, 'mean_word_length': 5.885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '7487541', 'n_tokens_mistral': 937, 'n_tokens_neox': 903, 'n_words': 149}