<commit_before>package uk.ac.ebi.eva.server.ws;

import com.jayway.restassured.RestAssured;
import com.jayway.restassured.path.json.JsonPath;
import com.jayway.restassured.response.Response;
import org.junit.BeforeClass;
import org.junit.Test;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;

import static com.jayway.restassured.RestAssured.given;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class VariantWSServerTest {

    @BeforeClass
    public static void startJetty() throws Exception {
        RestAssured.port = 8080;
        RestAssured.baseURI = "http://localhost:8080/eva/webservices/rest";
    }

    private void testGetVariantByIdRegionHelper(String testString) throws URISyntaxException {
        Response response = given().param("species", "mmusculus_grcm38").get(new URI("/v1/variants/" + testString + "/info"));
        response.then().statusCode(200);

        List queryResponse = JsonPath.from(response.asString()).getList("response");
        assertEquals(1, queryResponse.size());

        List<Map> result = JsonPath.from(response.asString()).getJsonObject("response[0].result");
//        assertTrue(result.size() == 1);

        Map m = result.get(0);

        String missingField = String.format("%s required field missing", m.get("id"));

        assertTrue(missingField, m.containsKey("id"));<commit_msg>Remove unused commented code.<commit_after>package uk.ac.ebi.eva.server.ws;

import com.jayway.restassured.RestAssured;
import com.jayway.restassured.path.json.JsonPath;
import com.jayway.restassured.response.Response;
import org.junit.BeforeClass;
import org.junit.Test;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;

import static com.jayway.restassured.RestAssured.given;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class VariantWSServerTest {

    @BeforeClass
    public static void startJetty() throws Exception {
        RestAssured.port = 8080;
        RestAssured.baseURI = "http://localhost:8080/eva/webservices/rest";
    }

    private void testGetVariantByIdRegionHelper(String testString) throws URISyntaxException {
        Response response = given().param("species", "mmusculus_grcm38").get(new URI("/v1/variants/" + testString + "/info"));
        response.then().statusCode(200);

        List queryResponse = JsonPath.from(response.asString()).getList("response");
        assertEquals(1, queryResponse.size());

        List<Map> result = JsonPath.from(response.asString()).getJsonObject("response[0].result");

        Map m = result.get(0);

        String missingField = String.format("%s required field missing", m.get("id"));

        assertTrue(missingField, m.containsKey("id"));
{'fraction_non_alphanumeric': 0.12797012898845891, 'fraction_numerical': 0.01188051595383571, 'mean_word_length': 4.30990990990991, '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': '2145518', 'n_tokens_mistral': 909, 'n_tokens_neox': 860, 'n_words': 164}