Ejemplo n.º 1
0
  @Test
  public void shouldDeleteCatalogo() {
    Catalogo catalogo = new Catalogo();
    catalogo.setId(12L);
    service.delete(catalogo);

    verify(dao).excluir(captor.capture());
    assertEquals(catalogo.getId(), captor.getValue().getId());
  }
Ejemplo n.º 2
0
 @Test
 public void shouldSaveWithAListMusic() {
   Long[] ids = new Long[3];
   ids[0] = 1L;
   ids[1] = 2L;
   ids[2] = 3L;
   service.save(ids);
   verify(dao).incluir(captor.capture());
   List<Music> musics = captor.getValue().getMusic();
   assertNotNull("Should set a list of music", musics);
   assertEquals(ids[0], musics.get(0).getId());
   assertEquals(ids[1], musics.get(1).getId());
   assertEquals(ids[2], musics.get(2).getId());
 }