Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Rubén Ramírez
/
MangAffinity
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
26cfcfec
authored
May 16, 2025
by
Rubén Ramírez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat: [TestUsuariosController]: Actualizada la función test para filtrar los usuarios
parent
0eaab471
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
src/test/java/com/ujaen/tfg/mangaffinity/rest/TestUsuariosController.java
src/test/java/com/ujaen/tfg/mangaffinity/rest/TestUsuariosController.java
View file @
26cfcfec
...
...
@@ -493,6 +493,7 @@ public class TestUsuariosController {
assertThat
(
usuario
.
getEmail
()).
isNull
();
// porque no se devuelve en el DTO
assertThat
(
usuario
.
getNombreUsuario
()).
isEqualTo
(
"VerUsuario"
);
}
@Test
@DirtiesContext
void
testFiltrarUsuariosPorNombre
()
{
...
...
@@ -531,12 +532,14 @@ public class TestUsuariosController {
assertThat
(
sinCoincidencias
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NO_CONTENT
);
// --- Caso 3: Sin parámetro ---
ResponseEntity
<
Void
>
sinParametro
=
restTemplateUsuarios
.
exchange
(
"/"
,
HttpMethod
.
GET
,
request
,
Void
.
class
ResponseEntity
<
DTOUsuario
[]>
respuestaGenerica
=
restTemplateUsuarios
.
exchange
(
"/"
,
HttpMethod
.
GET
,
request
,
DTOUsuario
[]
.
class
);
assertThat
(
sinParametro
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
BAD_REQUEST
);
assertThat
(
respuestaGenerica
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
DTOUsuario
[]
genericos
=
respuestaGenerica
.
getBody
();
assertThat
(
genericos
).
isNotNull
();
assertThat
(
genericos
.
length
).
isLessThanOrEqualTo
(
10
);
}
}
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