Commit 105c6e02 by =

Commit profesor

parent cd8767dc
......@@ -28,15 +28,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
......
......@@ -21,7 +21,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@SpringBootApplication(scanBasePackages = "es.ujaen.dae.beans")
public class UjapackApplication {
public static void main(String[] args){
......
......@@ -109,6 +109,7 @@ public class ServicioUjaPackImpl implements ServicioUjaPack{
/**
* @brief Funcion que nos indica el estado actual de un envio concreto
* @param e un envio
......
......@@ -6,25 +6,25 @@
package es.ujaen.dae.Ujapack.beans;
import es.ujaen.dae.Ujapack.UjapackApplication;
import es.ujaen.dae.beans.ServicioUjaPackImpl;
import java.util.function.BooleanSupplier;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
/**
*
* @author Rafael
*/
@Autowired
ServicioUjaPackImpl ujaPack;
@SpringBootTest(classes={UjapackApplication.class})
public class ServicioUjapackImplIntegrationTest {
@Autowired
ServicioUjaPackImpl ujaPack;
@Test
public void testcrearEnvio(){
Assertions.assertTrue(ujaPack.crearEnvio("Jose","Maria","Castellon","Islas Baleares",0.5f,20.4f,20.4f,20.4f));
Assertions.assertFalse(ujaPack.crearEnvio("Jose","Maria",20,"Sevilla",0.5f,20.4f,20.4f,20.4f));
public void testcrearEnvio(){
Assertions.assertNotNull(ujaPack.crearEnvio("Jose","Maria","Castellon","Islas Baleares",0.5f,20.4f,20.4f,20.4f));
}
......
......@@ -5,8 +5,11 @@
*/
package es.ujaen.dae.Ujapack.entidades;
import es.ujaen.dae.entidades.Envio;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
/**
......@@ -16,8 +19,12 @@ import org.junit.jupiter.api.Assertions;
public class EnvioTest {
@Test
public void testEnvioCorrecto(){}
@Test
public void testCalcularImporte(){
Envio e = new Envio("Jose","Maria","Castellon","Islas Baleares",0.5f,20.4f,20.4f,20.4f);
Assertions.assertNotNull(e.calcularImporte(e));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment