<commit_before>package focusedCrawler.target;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.*;

import java.net.URL;

import org.junit.Test;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.cbor.CBORFactory;

public class TargetModelTest {

    @Test
    public void shouldSerializeAndUnserializeFieldsCorrectly() throws Exception {
        // given
        ObjectMapper mapper = new ObjectMapper(new CBORFactory());

        final String name = "Name";
        final String email = "<EMAIL>";
        final String body = "Lorem ipsum dolor sit amet";
        final URL url = new URL("http://example.org/index.html");
        
        TargetModel writtenValue = new TargetModel(name, email, url, body);
        
        // when
        byte[] data = mapper.writeValueAsBytes(writtenValue);
        TargetModel readValue = mapper.readValue(data, TargetModel.class);

        // then
        assertThat(readValue, is(notNullValue()));
        
        assertThat(readValue.key, is(notNullValue()));
        assertThat(readValue.key, is(writtenValue.key));
        
        assertThat(readValue.timestamp, is(not(0L)));
        assertThat(readValue.timestamp, is(writtenValue.timestamp));
        
        assertThat(readValue.url, is(writtenValue.url));
        assertThat(readValue.url, is(url.toString()));
        
        assertThat(readValue.imported, is(writtenValue.imported));
        
        assertThat(readValue.request, is(notNullValue()));
        assertThat(readValue.request, is(writtenValue.request));
        
        assertThat(readValue.response, is(notNullValue()));
        assertThat(readValue.response, is(writtenValue.response));
        assertThat(readValue.response.get("body"), is(body));
    }

}<commit_msg>Fixed target model test<commit_after>package focusedCrawler.target;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.*;

import java.net.URL;

import org.junit.Test;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.cbor.CBORFactory;

public class TargetModelTest {

    @Test
    public void shouldSerializeAndUnserializeFieldsCorrectly() throws Exception {
        // given
        ObjectMapper mapper = new ObjectMapper(new CBORFactory());

        final String name = "Name";
        final String email = "<EMAIL>";
        final String body = "Lorem ipsum dolor sit amet";
        final URL url = new URL("http://example.org/index.html");
        
        TargetModel writtenValue = new TargetModel(name, email, url, body);
        
        // when
        byte[] data = mapper.writeValueAsBytes(writtenValue);
        TargetModel readValue = mapper.readValue(data, TargetModel.class);

        // then
        assertThat(readValue, is(notNullValue()));
        
        assertThat(readValue.key, is(notNullValue()));
        assertThat(readValue.key, is(writtenValue.key));
        
        assertThat(readValue.timestamp, is(not(0L)));
        assertThat(readValue.timestamp, is(writtenValue.timestamp));
        
        assertThat(readValue.url, is(writtenValue.url));
        assertThat(readValue.url, is(url.toString()));
        
        assertThat(readValue.imported, is(writtenValue.imported));
        
        assertThat(readValue.request, is(notNullValue()));
        assertThat(readValue.request, is(writtenValue.request));
        
        assertThat(readValue.response, is(notNullValue()));
        assertThat(readValue.response, is(writtenValue.response));
        assertThat(((String)readValue.response.get("body")), is(body));
    }

}
{'fraction_non_alphanumeric': 0.11528429838288994, 'fraction_numerical': 0.0005216484089723526, 'mean_word_length': 3.1594360086767894, 'pattern_counts': {'":': 0, '<': 5, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1886399', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1065, 'n_words': 203}