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));
}
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());
}
Aggregations