Search in sources :

Example 6 with FanZoneRepository

use of com.management.repositories.FanZoneRepository in project Internet-Software-Architectures by zivko11.

the class FanZoneControllerTests method DeletingFanZone_ReturnsOK.

@Test
public void DeletingFanZone_ReturnsOK() {
    Mockery mock = new Mockery();
    fanZoneRepository = mock.mock(FanZoneRepository.class);
    // Expectations
    mock.checking(new Expectations() {

        {
            oneOf(fanZoneRepository).delete(1);
        }
    });
    FanZoneManager manager = new FanZoneManager(fanZoneRepository);
    // Act and assert
    FanZoneController controller = new FanZoneController(manager);
    Assert.assertNotNull(controller);
    Assert.assertEquals(controller.deleteFanZone(1), new ResponseEntity<FanZoneDTO>(HttpStatus.OK));
    mock.assertIsSatisfied();
}
Also used : Expectations(org.jmock.Expectations) FanZoneManager(com.management.managers.FanZoneManager) FanZoneRepository(com.management.repositories.FanZoneRepository) FanZoneDTO(com.management.dto.FanZoneDTO) Mockery(org.jmock.Mockery) Test(org.junit.Test)

Aggregations

FanZoneRepository (com.management.repositories.FanZoneRepository)6 Expectations (org.jmock.Expectations)6 Mockery (org.jmock.Mockery)6 Test (org.junit.Test)6 FanZoneDTO (com.management.dto.FanZoneDTO)5 FanZone (com.management.entities.FanZone)4 FanZoneManager (com.management.managers.FanZoneManager)3 ArrayList (java.util.ArrayList)2 List (java.util.List)1