<commit_before>// Copyright 2014 Tool Inc.

package com.tool.emailbot.resource;

import com.tool.emailbot.PersistenceTest;
import com.tool.emailbot.application.command.EstatusCommand;
import com.tool.emailbot.application.command.RegisterDependencia;
import com.tool.emailbot.application.command.RegisterInformacionContacto;
import com.tool.emailbot.application.command.RegisterPersona;
import com.tool.emailbot.application.command.RegisterPeticion;
import com.tool.emailbot.application.command.RegisterTrabajador;
import com.tool.emailbot.application.command.SituacionLaboralCommand;
import com.tool.emailbot.infraestructure.resource.GsonProvider;
import com.tool.emailbot.infraestructure.resource.JaxRsActivator;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import java.net.URL;
import java.util.Date;
import java.util.GregorianCalendar;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * Test for {@link com.tool.emailbot.resource.RegisterEmailResource}.
 *
 *  @author <NAME> (<EMAIL>)
 */
@RunAsClient
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class RegisterEmailResourceTest extends PersistenceTest {
    private static final String RESOURCE_PREFIX = JaxRsActivator.class
            .getAnnotation(ApplicationPath.class).value().substring(1) + "/register/";

    private final String mediaType = MediaType.APPLICATION_JSON;
    @ArquillianResource private URL deploymentUrl;
    private Client client;
    private WebTarget target;

    @Before
    public void initClient() {
        client = ClientBuilder.newClient().register(GsonProvider.class);
        target = this.client.target(deploymentUrl.toString() + RESOURCE_PREFIX);
    }

    @Test
    public void shouldRegisterPersonUser() throws Exception {
        RegisterDependencia dependencia =
                new RegisterDependencia("DGTIC",
                        "Direccion General de Telecomunicaciones y Computo");
        RegisterInformacionContacto informacionContacto = new RegisterInformacionContacto(
                "<EMAIL>", "571201109");
	RegisterPersona persona;
	persona = new RegisterPersona("Jovani", "Martinez", "Rico",new Date(1990,07,26),
		"ohm", "jov", informacionContacto.getInformacionContactoCommand());
	RegisterTrabajador trabajador = new RegisterTrabajador(persona.getPersonaCommand(),<commit_msg>Fixing code style<commit_after>// Copyright 2014 Tool Inc.

package com.tool.emailbot.resource;

import com.tool.emailbot.PersistenceTest;
import com.tool.emailbot.application.command.EstatusCommand;
import com.tool.emailbot.application.command.RegisterDependencia;
import com.tool.emailbot.application.command.RegisterInformacionContacto;
import com.tool.emailbot.application.command.RegisterPersona;
import com.tool.emailbot.application.command.RegisterPeticion;
import com.tool.emailbot.application.command.RegisterTrabajador;
import com.tool.emailbot.application.command.SituacionLaboralCommand;
import com.tool.emailbot.infraestructure.resource.GsonProvider;
import com.tool.emailbot.infraestructure.resource.JaxRsActivator;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import java.net.URL;
import java.util.Date;
import java.util.GregorianCalendar;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * Test for {@link com.tool.emailbot.resource.RegisterEmailResource}.
 *
 *  @author <NAME> (<EMAIL>)
 */
@RunAsClient
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class RegisterEmailResourceTest extends PersistenceTest {
    private static final String RESOURCE_PREFIX = JaxRsActivator.class
            .getAnnotation(ApplicationPath.class).value().substring(1) + "/register/";

    private final String mediaType = MediaType.APPLICATION_JSON;
    @ArquillianResource private URL deploymentUrl;
    private Client client;
    private WebTarget target;

    @Before
    public void initClient() {
        client = ClientBuilder.newClient().register(GsonProvider.class);
        target = this.client.target(deploymentUrl.toString() + RESOURCE_PREFIX);
    }

    @Test
    public void shouldRegisterPersonUser() throws Exception {
        RegisterDependencia dependencia =
                new RegisterDependencia("DGTIC",
                        "Direccion General de Telecomunicaciones y Computo");
        RegisterInformacionContacto informacionContacto = new RegisterInformacionContacto(
                "<EMAIL>", "571201109");
	RegisterPersona persona;
	persona = new RegisterPersona("Jovani", "Martinez", "Rico",
            new GregorianCalendar(1990,07,26).getTime(), "ohm", "jov",
            informacionContacto.getInformacionContactoCommand());
	RegisterTrabajador trabajador = new RegisterTrabajador(persona.getPersonaCommand(),
{'fraction_non_alphanumeric': 0.10070052539404553, 'fraction_numerical': 0.007705779334500876, 'mean_word_length': 4.918134715025907, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1895337', 'n_tokens_mistral': 1731, 'n_tokens_neox': 1656, 'n_words': 304}