<commit_before>package org.lenition.functional;

import org.junit.Test;

import static com.jayway.restassured.RestAssured.expect;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;

public class FactbookServletTest {

    @Test
    public void testQuestionsSize() {
        final int parameter = 10;
        expect().
            body("questions.size", equalTo(parameter)).
            when().
            get("/factbook/questions?n={n}", String.valueOf(parameter));
    }

    @Test
    public void testNonNullFields() {
        final int parameter = 100;
        expect().
            body("questions", not(containsString(" null"))).
            when().
            get("/factbook/questions?n={n}", String.valueOf(parameter));
    }
}<commit_msg>Added allow-origin headers test.<commit_after>package org.lenition.functional;

import org.junit.Test;

import static com.jayway.restassured.RestAssured.expect;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;

public class FactbookServletTest {

    @Test
    public void testQuestionsSize() {
        final int parameter = 10;
        expect().
            body("questions.size", equalTo(parameter)).
            when().
            get("/factbook/questions?n={n}", String.valueOf(parameter));
    }

    @Test
    public void testNonNullFields() {
        final int parameter = 100;
        expect().
            body("questions", not(containsString(" null"))).
            when().
            get("/factbook/questions?n={n}", String.valueOf(parameter));
    }

    @Test
    public void testAllowOriginHeaders() {
        expect().
            header("Access-Control-Allow-Origin", "*").
            when().
            get("/factbook/questions");
    }
}
{'fraction_non_alphanumeric': 0.128518321826872, 'fraction_numerical': 0.0053106744556558685, 'mean_word_length': 2.637065637065637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1568779', 'n_tokens_mistral': 542, 'n_tokens_neox': 510, 'n_words': 107}