<commit_before>package org.springframework.roo.addon.serializable;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.roo.classpath.PhysicalTypeMetadata;
import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails;
import org.springframework.roo.classpath.details.ItdTypeDetails;
import org.springframework.roo.classpath.details.ItdTypeDetailsTestCase;
import org.springframework.roo.model.JavaPackage;
import org.springframework.roo.model.JavaType;
import org.springframework.roo.model.JdkJavaType;

/**
 * Unit test of {@link SerializableMetadata}
 *
 * @author <NAME>
 * @since 1.2.0
 */
public class SerializableMetadataTest extends ItdTypeDetailsTestCase {

	// Constants
	private static final String METADATA_ID = "MID:org.springframework.roo.addon.serializable.SerializableMetadata#SRC_MAIN_JAVA?com.example.Person";
	
	// Fixture
	@Mock private ClassOrInterfaceTypeDetails mockClassDetails;
	@Mock private JavaPackage mockPackage;
	@Mock private JavaType mockAspectName;
	@Mock private JavaType mockTargetType;
	@Mock private PhysicalTypeMetadata mockGovernor;
	
	@Before
	public void setUp() {
		MockitoAnnotations.initMocks(this);
		when(mockAspectName.getPackage()).thenReturn(mockPackage);
		when(mockClassDetails.getName()).thenReturn(mockTargetType);
		when(mockGovernor.getMemberHoldingTypeDetails()).thenReturn(mockClassDetails);
	}
	
	/**
	 * Asserts that the ITD has the expected contents when the governor does or<commit_msg>ROO-2839: Standardise how Roo annotation values are read - fixed failing test<commit_after>package org.springframework.roo.addon.serializable;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.roo.classpath.PhysicalTypeMetadata;
import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails;
import org.springframework.roo.classpath.details.ItdTypeDetails;
import org.springframework.roo.model.JavaPackage;
import org.springframework.roo.model.JavaType;
import org.springframework.roo.model.JdkJavaType;

/**
 * Unit test of {@link SerializableMetadata}
 *
 * @author <NAME>
 * @since 1.2.0
 */
public class SerializableMetadataTest {

	// Constants
	private static final String METADATA_ID = "MID:org.springframework.roo.addon.serializable.SerializableMetadata#SRC_MAIN_JAVA?com.example.Person";
	
	// Fixture
	@Mock private ClassOrInterfaceTypeDetails mockClassDetails;
	@Mock private JavaPackage mockPackage;
	@Mock private JavaType mockAspectName;
	@Mock private JavaType mockTargetType;
	@Mock private PhysicalTypeMetadata mockGovernor;
	
	@Before
	public void setUp() {
		MockitoAnnotations.initMocks(this);
		when(mockAspectName.getPackage()).thenReturn(mockPackage);
		when(mockClassDetails.getName()).thenReturn(mockTargetType);
		when(mockGovernor.getMemberHoldingTypeDetails()).thenReturn(mockClassDetails);
	}
	
	/**
	 * Asserts that the ITD has the expected contents when the governor does or
{'fraction_non_alphanumeric': 0.09375, 'fraction_numerical': 0.003094059405940594, 'mean_word_length': 6.432183908045977, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5716415', 'n_tokens_mistral': 976, 'n_tokens_neox': 936, 'n_words': 191}