Search in sources :

Example 1 with FriendsListRepositoryFake

use of com.management.fake.FriendsListRepositoryFake in project Internet-Software-Architectures by zivko11.

the class FriendsListControllerTests method AddingNewFriendsList_ReturnsOK.

@Test
public void AddingNewFriendsList_ReturnsOK() {
    // Arrange
    friendsListRepository = new FriendsListRepositoryFake();
    FriendslistDTO dto = new FriendslistDTO();
    dto.setFriendsStatus('P');
    FriendsListManager manager = new FriendsListManager(friendsListRepository);
    FriendsListController controller = new FriendsListController(manager);
    // Act and assert
    Assert.assertNotNull(controller);
    Assert.assertEquals(controller.addFriendslist(dto), new ResponseEntity<FriendslistDTO>(dto, HttpStatus.OK));
}
Also used : FriendslistDTO(com.management.dto.FriendslistDTO) FriendsListRepositoryFake(com.management.fake.FriendsListRepositoryFake) FriendsListManager(com.management.managers.FriendsListManager) Test(org.junit.Test)

Example 2 with FriendsListRepositoryFake

use of com.management.fake.FriendsListRepositoryFake in project Internet-Software-Architectures by zivko11.

the class FriendsListManagerTest method AddingNewFriendsList_ReturnsBoolean.

@Test
public void AddingNewFriendsList_ReturnsBoolean() {
    // Arrange
    friendsListRepository = new FriendsListRepositoryFake();
    FriendslistDTO dto = new FriendslistDTO();
    dto.setFriendsStatus('P');
    FriendsListManager manager = new FriendsListManager(friendsListRepository);
    // Act and assert
    Assert.assertNotNull(manager);
    Assert.assertTrue(manager.Create(dto));
    Friendslist list = friendsListRepository.findOne(0);
    Assert.assertEquals(dto.getFriendsStatus(), list.getFriendsStatus());
}
Also used : FriendslistDTO(com.management.dto.FriendslistDTO) FriendsListRepositoryFake(com.management.fake.FriendsListRepositoryFake) Friendslist(com.management.entities.Friendslist) Test(org.junit.Test)

Aggregations

FriendslistDTO (com.management.dto.FriendslistDTO)2 FriendsListRepositoryFake (com.management.fake.FriendsListRepositoryFake)2 Test (org.junit.Test)2 Friendslist (com.management.entities.Friendslist)1 FriendsListManager (com.management.managers.FriendsListManager)1