Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
DAE-Ujapack
/
Ujapack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
105c6e02
authored
Oct 26, 2020
by
=
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Commit profesor
parent
cd8767dc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
19 deletions
pom.xml
src/main/java/es/ujaen/dae/Ujapack/UjapackApplication.java
src/main/java/es/ujaen/dae/beans/ServicioUjaPackImpl.java
src/test/java/es/ujaen/dae/Ujapack/beans/ServicioUjapackImplIntegrationTest.java
src/test/java/es/ujaen/dae/Ujapack/entidades/EnvioTest.java
pom.xml
View file @
105c6e02
...
...
@@ -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>
...
...
src/main/java/es/ujaen/dae/Ujapack/UjapackApplication.java
View file @
105c6e02
...
...
@@ -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
){
...
...
src/main/java/es/ujaen/dae/beans/ServicioUjaPackImpl.java
View file @
105c6e02
...
...
@@ -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
...
...
src/test/java/es/ujaen/dae/Ujapack/beans/ServicioUjapackImplIntegrationTest.java
View file @
105c6e02
...
...
@@ -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
));
}
...
...
src/test/java/es/ujaen/dae/Ujapack/entidades/EnvioTest.java
View file @
105c6e02
...
...
@@ -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
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment