Skip to content

Commit

Permalink
feat: ne ProductoControler test added
Browse files Browse the repository at this point in the history
  • Loading branch information
rpuigm authored Feb 10, 2024
1 parent 962a58d commit 34796dc
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.ostemplate.app.productos.controllers;

import static org.junit.Assert.*;

import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
Expand Down Expand Up @@ -56,6 +58,15 @@ public void subidaImagen() {

}

@Test
public void detalleTest(){
Producto producto = mapToProductoDummy();
Mockito.when(productoServiceI.findById(Mockito.anyLong()))
.thenReturn(producto);
assertEquals(productoController.detalle(1L),producto);

}

private Producto mapToProductoDummy() {
EasyRandom generator = new EasyRandom();
Producto producto = generator.nextObject(Producto.class);
Expand Down

0 comments on commit 34796dc

Please sign in to comment.