@Test public void testCreateLocalStateFirstTime() throws Exception { context.checking(new Expectations() {{ oneOf(contactGroupFactory).createLocalGroup(CLIENT_ID, MAJOR_VERSION); will(returnValue(localGroup)); oneOf(db).containsGroup(txn, localGroup.getId()); will(returnValue(false)); oneOf(db).addGroup(txn, localGroup); oneOf(db).getContacts(txn); will(returnValue(Collections.singletonList(contact))); }}); expectAddingContact(contact); groupInvitationManager.createLocalState(txn); }
@Override public void createLocalState(Transaction txn) throws DbException { Group localGroup = contactGroupFactory.createLocalGroup(CLIENT_ID, MAJOR_VERSION); if (db.containsGroup(txn, localGroup.getId())) return; db.addGroup(txn, localGroup); for (Contact c : db.getContacts(txn)) addingContact(txn, c); }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override public void createLocalState(Transaction txn) throws DbException { Group localGroup = contactGroupFactory.createLocalGroup(CLIENT_ID, MAJOR_VERSION); if (db.containsGroup(txn, localGroup.getId())) return; db.addGroup(txn, localGroup); for (Contact c : db.getContacts(txn)) addingContact(txn, c); } }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override public void createLocalState(Transaction txn) throws DbException { Group localGroup = contactGroupFactory.createLocalGroup(CLIENT_ID, MAJOR_VERSION); if (db.containsGroup(txn, localGroup.getId())) return; db.addGroup(txn, localGroup); for (Contact c : db.getContacts(txn)) addingContact(txn, c); } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override public void createLocalState(Transaction txn) throws DbException { Group localGroup = contactGroupFactory.createLocalGroup(CLIENT_ID, MAJOR_VERSION); if (db.containsGroup(txn, localGroup.getId())) return; db.addGroup(txn, localGroup); for (Contact c : db.getContacts(txn)) addingContact(txn, c); } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); @Override void createLocalState(Transaction txn); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override Group getContactGroup(Contact c); @Override void sendInvitation(GroupId privateGroupId, ContactId c,
			@Nullable String message, long timestamp, byte[] signature); @Override void respondToInvitation(ContactId c, PrivateGroup g, boolean accept); @Override void respondToInvitation(ContactId c, SessionId sessionId,
			boolean accept); @Override void revealRelationship(ContactId c, GroupId g); @Override Collection<InvitationMessage> getInvitationMessages(ContactId c); @Override Collection<GroupInvitationItem> getInvitations(); @Override boolean isInvitationAllowed(Contact c, GroupId privateGroupId); @Override void addingMember(Transaction txn, GroupId privateGroupId, Author a); @Override void removingGroup(Transaction txn, GroupId privateGroupId); @Override void onClientVisibilityChanging(Transaction txn, Contact c,
			Visibility v); }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override public void createLocalState(Transaction txn) throws DbException { Group localGroup = contactGroupFactory.createLocalGroup(CLIENT_ID, MAJOR_VERSION); if (db.containsGroup(txn, localGroup.getId())) return; db.addGroup(txn, localGroup); for (Contact c : db.getContacts(txn)) addingContact(txn, c); } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); @Override void createLocalState(Transaction txn); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override Group getContactGroup(Contact c); @Override void sendInvitation(GroupId privateGroupId, ContactId c,
			@Nullable String message, long timestamp, byte[] signature); @Override void respondToInvitation(ContactId c, PrivateGroup g, boolean accept); @Override void respondToInvitation(ContactId c, SessionId sessionId,
			boolean accept); @Override void revealRelationship(ContactId c, GroupId g); @Override Collection<InvitationMessage> getInvitationMessages(ContactId c); @Override Collection<GroupInvitationItem> getInvitations(); @Override boolean isInvitationAllowed(Contact c, GroupId privateGroupId); @Override void addingMember(Transaction txn, GroupId privateGroupId, Author a); @Override void removingGroup(Transaction txn, GroupId privateGroupId); @Override void onClientVisibilityChanging(Transaction txn, Contact c,
			Visibility v);  }