@Test public void testStoresRemotePropertiesWithVersion0() throws Exception { Contact contact = getContact(true); Group contactGroup = getGroup(CLIENT_ID, MAJOR_VERSION); Transaction txn = new Transaction(null, false); Map<TransportId, TransportProperties> properties = new LinkedHashMap<>(); properties.put(new TransportId("foo"), fooProperties); properties.put(new TransportId("bar"), barProperties); context.checking(new Expectations() {{ oneOf(db).getContact(txn, contact.getId()); will(returnValue(contact)); oneOf(contactGroupFactory).createContactGroup(CLIENT_ID, MAJOR_VERSION, contact); will(returnValue(contactGroup)); }}); expectStoreMessage(txn, contactGroup.getId(), "foo", fooPropertiesDict, 0, false, false); expectStoreMessage(txn, contactGroup.getId(), "bar", barPropertiesDict, 0, false, false); TransportPropertyManagerImpl t = createInstance(); t.addRemoteProperties(txn, contact.getId(), properties); }
@Override public void addRemoteProperties(Transaction txn, ContactId c, Map<TransportId, TransportProperties> props) throws DbException { Group g = getContactGroup(db.getContact(txn, c)); for (Entry<TransportId, TransportProperties> e : props.entrySet()) { storeMessage(txn, g.getId(), e.getKey(), e.getValue(), 0, false, false); } }
TransportPropertyManagerImpl implements TransportPropertyManager,
		Client, ContactHook, ClientVersioningHook, IncomingMessageHook { @Override public void addRemoteProperties(Transaction txn, ContactId c, Map<TransportId, TransportProperties> props) throws DbException { Group g = getContactGroup(db.getContact(txn, c)); for (Entry<TransportId, TransportProperties> e : props.entrySet()) { storeMessage(txn, g.getId(), e.getKey(), e.getValue(), 0, false, false); } } }
TransportPropertyManagerImpl implements TransportPropertyManager,
		Client, ContactHook, ClientVersioningHook, IncomingMessageHook { @Override public void addRemoteProperties(Transaction txn, ContactId c, Map<TransportId, TransportProperties> props) throws DbException { Group g = getContactGroup(db.getContact(txn, c)); for (Entry<TransportId, TransportProperties> e : props.entrySet()) { storeMessage(txn, g.getId(), e.getKey(), e.getValue(), 0, false, false); } } @Inject  TransportPropertyManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser,
			ContactGroupFactory contactGroupFactory, Clock clock); }
TransportPropertyManagerImpl implements TransportPropertyManager,
		Client, ContactHook, ClientVersioningHook, IncomingMessageHook { @Override public void addRemoteProperties(Transaction txn, ContactId c, Map<TransportId, TransportProperties> props) throws DbException { Group g = getContactGroup(db.getContact(txn, c)); for (Entry<TransportId, TransportProperties> e : props.entrySet()) { storeMessage(txn, g.getId(), e.getKey(), e.getValue(), 0, false, false); } } @Inject  TransportPropertyManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser,
			ContactGroupFactory contactGroupFactory, Clock clock); @Override void createLocalState(Transaction txn); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override void onClientVisibilityChanging(Transaction txn, Contact c,
			Visibility v); @Override boolean incomingMessage(Transaction txn, Message m, Metadata meta); @Override void addRemoteProperties(Transaction txn, ContactId c,
			Map<TransportId, TransportProperties> props); @Override Map<TransportId, TransportProperties> getLocalProperties(); @Override Map<TransportId, TransportProperties> getLocalProperties(
			Transaction txn); @Override TransportProperties getLocalProperties(TransportId t); @Override Map<ContactId, TransportProperties> getRemoteProperties(
			TransportId t); @Override TransportProperties getRemoteProperties(ContactId c, TransportId t); @Override void mergeLocalProperties(TransportId t, TransportProperties p); }
TransportPropertyManagerImpl implements TransportPropertyManager,
		Client, ContactHook, ClientVersioningHook, IncomingMessageHook { @Override public void addRemoteProperties(Transaction txn, ContactId c, Map<TransportId, TransportProperties> props) throws DbException { Group g = getContactGroup(db.getContact(txn, c)); for (Entry<TransportId, TransportProperties> e : props.entrySet()) { storeMessage(txn, g.getId(), e.getKey(), e.getValue(), 0, false, false); } } @Inject  TransportPropertyManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser,
			ContactGroupFactory contactGroupFactory, Clock clock); @Override void createLocalState(Transaction txn); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override void onClientVisibilityChanging(Transaction txn, Contact c,
			Visibility v); @Override boolean incomingMessage(Transaction txn, Message m, Metadata meta); @Override void addRemoteProperties(Transaction txn, ContactId c,
			Map<TransportId, TransportProperties> props); @Override Map<TransportId, TransportProperties> getLocalProperties(); @Override Map<TransportId, TransportProperties> getLocalProperties(
			Transaction txn); @Override TransportProperties getLocalProperties(TransportId t); @Override Map<ContactId, TransportProperties> getRemoteProperties(
			TransportId t); @Override TransportProperties getRemoteProperties(ContactId c, TransportId t); @Override void mergeLocalProperties(TransportId t, TransportProperties p);  }