use of com.management.fake.ActorRepositoryFake in project Internet-Software-Architectures by zivko11.
the class ActorControllerTests method AddingNewActor_ReturnsOK.
@Test
public void AddingNewActor_ReturnsOK() {
// Arrange
Mockery mock = new Mockery();
actorRepository = new ActorRepositoryFake();
ActorDTO dto = new ActorDTO();
dto.setAcName("Zivko");
dto.setAcSurname("Stanisic");
ActorManager manager = new ActorManager(actorRepository);
ActorController controller = new ActorController(manager);
// Act and assert
Assert.assertNotNull(controller);
Assert.assertEquals(controller.addActor(dto), new ResponseEntity<ActorDTO>(dto, HttpStatus.OK));
mock.assertIsSatisfied();
}
use of com.management.fake.ActorRepositoryFake in project Internet-Software-Architectures by zivko11.
the class ActorManagerTests method AddingNewActor_ReturnsBoolean.
@Test
public void AddingNewActor_ReturnsBoolean() {
// Arrange
Mockery mock = new Mockery();
actorRepository = new ActorRepositoryFake();
ActorDTO dto = new ActorDTO();
dto.setAcName("Zivko");
dto.setAcSurname("Stanisic");
ActorManager manager = new ActorManager(actorRepository);
// Act and assert
Assert.assertNotNull(manager);
Assert.assertTrue(manager.Create(dto));
Actor actor = actorRepository.findOne(0);
Assert.assertEquals(dto.getAcName(), actor.getAcName());
Assert.assertEquals(dto.getAcSurname(), actor.getAcSurname());
mock.assertIsSatisfied();
}
Aggregations