com.silverpeas.profile.web.mock
Class RelationShipServiceMock

java.lang.Object
  extended by com.silverpeas.socialnetwork.relationShip.RelationShipService
      extended by com.silverpeas.profile.web.mock.RelationShipServiceMock

@Named(value="relationShipService")
public class RelationShipServiceMock
extends RelationShipService

A mock of the RelationShipService service dedicated to tests managed by the IoC container. It is yet a wrapper around the RelationShipService mock to which are delagated the methods invocations. The wrapped mock can be obtained to record behaviours expected by tests.


Constructor Summary
RelationShipServiceMock()
           
 
Method Summary
 List<String> getAllCommonContactsIds(int user1Id, int user2Id)
           
 List<RelationShip> getAllMyRelationShips(int myId)
           
 List<SocialInformation> getAllMyRelationShips(String userId, Date begin, Date end)
           
 List<SocialInformation> getAllRelationShipsOfMyContact(String myId, List<String> myContactsIds, Date begin, Date end)
           
 RelationShipService getMockedRelationShipService()
           
 List<String> getMyContactsIds(int myId)
           
 RelationShip getRelationShip(int user1Id, int user2Id)
           
 boolean isInRelationShip(int user1Id, int user2Id)
           
 boolean removeRelationShip(int idUser1, int idUser2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationShipServiceMock

public RelationShipServiceMock()
Method Detail

getMockedRelationShipService

public RelationShipService getMockedRelationShipService()

removeRelationShip

public boolean removeRelationShip(int idUser1,
                                  int idUser2)
Overrides:
removeRelationShip in class RelationShipService

isInRelationShip

public boolean isInRelationShip(int user1Id,
                                int user2Id)
                         throws SQLException
Overrides:
isInRelationShip in class RelationShipService
Throws:
SQLException

getRelationShip

public RelationShip getRelationShip(int user1Id,
                                    int user2Id)
                             throws SQLException
Overrides:
getRelationShip in class RelationShipService
Throws:
SQLException

getMyContactsIds

public List<String> getMyContactsIds(int myId)
                              throws SQLException
Overrides:
getMyContactsIds in class RelationShipService
Throws:
SQLException

getAllRelationShipsOfMyContact

public List<SocialInformation> getAllRelationShipsOfMyContact(String myId,
                                                              List<String> myContactsIds,
                                                              Date begin,
                                                              Date end)
                                                       throws SQLException
Overrides:
getAllRelationShipsOfMyContact in class RelationShipService
Throws:
SQLException

getAllMyRelationShips

public List<SocialInformation> getAllMyRelationShips(String userId,
                                                     Date begin,
                                                     Date end)
                                              throws SQLException
Overrides:
getAllMyRelationShips in class RelationShipService
Throws:
SQLException

getAllMyRelationShips

public List<RelationShip> getAllMyRelationShips(int myId)
                                         throws SQLException
Overrides:
getAllMyRelationShips in class RelationShipService
Throws:
SQLException

getAllCommonContactsIds

public List<String> getAllCommonContactsIds(int user1Id,
                                            int user2Id)
                                     throws SQLException
Overrides:
getAllCommonContactsIds in class RelationShipService
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.