GitHub PullRequestReviewCommentEvent at 2014-03-24 05:16:24
Repository: falafel
Actor: leopic
Payload: {"comment":{"url":"https://api.github.com/repos/GangOfFive/falafel/pulls/comments/10872953","id":10872953,"diff_hunk":"@@ -0,0 +1,275 @@\n+package com.gangfive.sima.services;\n+\n+import static org.junit.Assert.*;\n+\n+import java.io.File;\n+import java.io.FileInputStream;\n+import java.io.FileNotFoundException;\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.net.URL;\n+import java.util.Calendar;\n+import java.util.Date;\n+\n+import javax.servlet.ServletContext;\n+\n+import org.junit.Test;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.transaction.annotation.Transactional;\n+\n+import com.gangfive.sima.contracts.OperationResult;\n+import com.gangfive.sima.ejb.CalendarioCita;\n+import com.gangfive.sima.ejb.Nutricionista;\n+import com.gangfive.sima.ejb.Paciente;\n+import com.gangfive.sima.repositories.CalendarioCitaRepository;\n+import com.gangfive.sima.repositories.NutricionistasRepository;\n+import com.gangfive.sima.repositories.PacientesRepository;\n+import com.sun.jersey.core.header.FormDataContentDisposition;\n+import com.sun.jersey.multipart.FormDataBodyPart;\n+import com.sun.jersey.multipart.FormDataMultiPart;\n+\n+public class RegistroCalendarioCitaServiceTest extends ServiceTest {\n+\t@Autowired\n+\tprivate ICalendarioCitaService citaService;\n+\n+\t@Autowired\n+\tprivate CalendarioCitaRepository citaRepo;\n+\n+\t@Autowired\n+\tprivate NutricionistasRepository nutriRepo;\n+\n+\t@Autowired\n+\tprivate PacientesRepository pacienteRepo;\n+\t\n+\t@Autowired\n+\tServletContext servletContext;\n+\n+\t@Test\n+\t@Transactional\n+\tpublic void actualizarTest() {\n+\t\tCalendarioCita cita = crearCita(getPaciente(), getNutricionista(), crearFecha(30, 10, 0), crearFecha(30, 11, 00));\n+\t\tDouble peso = 85D,\n+\t\t\t\taltura = 1.85D,\n+\t\t\t\tmedidaPecho = 80D,\n+\t\t\t\tmedidaCintura = 95D,\n+\t\t\t\tmedidaCircunferencia = 75D,\n+\t\t\t\tcalorias = 2000D,\n+\t\t\t\tcarbohidratos = 7D,\n+\t\t\t\tproteinas = 5D,\n+\t\t\t\tvegetales = 4D,\n+\t\t\t\tgrasas = 3D,\n+\t\t\t\tfrutas = 2D,\n+\t\t\t\tagua = 1D;\n+\t\t\n+\t\tString notasPrivadas = \"nota privada\",\n+\t\t\t\tnotasPublicas = \"nota publica\";\n+\t\t\n+\t\tcita.setPeso(peso);\n+\t\tcita.setAltura(altura);\n+\t\tcita.setMedidaPecho(medidaPecho);\n+\t\tcita.setMedidaCintura(medidaCintura);\n+\t\tcita.setMedidaCircunferencia(medidaCircunferencia);\n+\t\tcita.setNotasPrivadas(notasPrivadas);\n+\t\tcita.setNotasPublicas(notasPublicas);\n+\t\tcita.setCalorias(calorias);\n+\t\tcita.setCarbohidratos(carbohidratos);\n+\t\tcita.setProteinas(proteinas);\n+\t\tcita.setVegetales(vegetales);\n+\t\tcita.setGrasas(grasas);\n+\t\tcita.setFrutas(frutas);\n+\t\tcita.setAgua(agua);\n+\t\t\n+\t\tassertEquals(\"Verificando que el resultado de actualizar el registro de cita es OK\",\n+\t\t\t\tOperationResult.OK, citaService.actualizar(cita));\n+\t\t\n+\t\tcita = citaService.getCalendarioCita(cita.getId());\n+\t\t\n+\t\tassertEquals(\"Verificando que se actualizara el peso\",\n+\t\t\t\tpeso, cita.getPeso());\n+\t\tassertEquals(\"Verificando que se actualizara la altura\",\n+\t\t\t\taltura, cita.getAltura());\n+\t\tassertEquals(\"Verificando que se actualizara la medidaPecho\",\n+\t\t\t\tmedidaPecho, cita.getMedidaPecho());\n+\t\tassertEquals(\"Verificando que se actualizara la medidaCintura\",\n+\t\t\t\tmedidaCintura, cita.getMedidaCintura());\n+\t\tassertEquals(\"Verificando que se actualizara la medidaCircunferencia\",\n+\t\t\t\tmedidaCircunferencia, cita.getMedidaCircunferencia());\n+\t\tassertEquals(\"Verificando que se actualizara notasPrivadas\",\n+\t\t\t\tnotasPrivadas, cita.getNotasPrivadas());\n+\t\tassertEquals(\"Verificando que se actualizara notasPublicas\",\n+\t\t\t\tnotasPublicas, cita.getNotasPublicas());\n+\t\tassertEquals(\"Verificando que se actualizara calorias\",\n+\t\t\t\tcalorias, cita.getCalorias());\n+\t\tassertEquals(\"Verificando que se actualizara carbohidratos\",\n+\t\t\t\tcarbohidratos, cita.getCarbohidratos());\n+\t\tassertEquals(\"Verificando que se actualizara proteinas\",\n+\t\t\t\tproteinas, cita.getProteinas());\n+\t\tassertEquals(\"Verificando que se actualizara vegetales\",\n+\t\t\t\tvegetales, cita.getVegetales());\n+\t\tassertEquals(\"Verificando que se actualizara grasas\",\n+\t\t\t\tgrasas, cita.getGrasas());\n+\t\tassertEquals(\"Verificando que se actualizara frutas\",\n+\t\t\t\tfrutas, cita.getFrutas());\n+\t\tassertEquals(\"Verificando que se actualizara agua\",\n+\t\t\t\tagua, cita.getAgua());\n+\t\t\n+\t\tcitaRepo.delete(cita);\n+\t}\n+\t\n+\t@Test\n+\t@Transactional\n+\tpublic void testGetCalendarioCitaAnterior() {\n+\t\tCalendarioCita citaAnterior = crearCita(getPaciente(), getNutricionista(),\n+\t\t\t\tcrearFecha(1, 10, 0), crearFecha(1, 11, 00));\n+\t\t\n+\t\tCalendarioCita citaActual = crearCita(getPaciente(), getNutricionista(),\n+\t\t\t\tcrearFecha(15, 10, 0), crearFecha(15, 11, 00));\n+\t\t\n+\t\tassertEquals(\"Verificando que se puede obtener la cita anterior de un paciente\",","path":"src/test/java/com/gangfive/sima/services/RegistroCalendarioCitaServiceTest.java","position":128,"original_position":128,"commit_id":"bdda858e699a3aad7c48d5958f0d0fa9e27d584d","original_commit_id":"bdda858e699a3aad7c48d5958f0d0fa9e27d584d","user":{"login":"leopic","id":117184,"avatar_url":"https://avatars.githubusercontent.com/u/117184?","gravatar_id":"203972c39c4eea9a563450362c49133b","url":"https://api.github.com/users/leopic","html_url":"https://github.com/leopic","followers_url":"https://api.github.com/users/leopic/followers","following_url":"https://api.github.com/users/leopic/following{/other_user}","gists_url":"https://api.github.com/users/leopic/gists{/gist_id}","starred_url":"https://api.github.com/users/leopic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leopic/subscriptions","organizations_url":"https://api.github.com/users/leopic/orgs","repos_url":"https://api.github.com/users/leopic/repos","events_url":"https://api.github.com/users/leopic/events{/privacy}","received_events_url":"https://api.github.com/users/leopic/received_events","type":"User","site_admin":false},"body":"muy chiva :+1: ","created_at":"2014-03-24T05:16:24Z","updated_at":"2014-03-24T05:16:24Z","html_url":"https://github.com/GangOfFive/falafel/pull/57#discussion_r10872953","pull_request_url":"https://api.github.com/repos/GangOfFive/falafel/pulls/57","_links":{"self":{"href":"https://api.github.com/repos/GangOfFive/falafel/pulls/comments/10872953"},"html":{"href":"https://github.com/GangOfFive/falafel/pull/57#discussion_r10872953"},"pull_request":{"href":"https://api.github.com/repos/GangOfFive/falafel/pulls/57"}}}}