@Test public void switchBetweenIdentitesTest() throws Exception { clientConfiguration.selectIdentity(i); controller.sendDropMessage(c, "msg1"); i = identityBuilderFactory.factory().withAlias("NewIdentity").build(); c = new Contact(i.getAlias(), i.getDropUrls(), i.getEcPublicKey()); clientConfiguration.selectIdentity(i); controller.sendDropMessage(c, "msg2"); List<PersistenceDropMessage> lst = dropMessageRepository.loadConversation(c, i); assertEquals(1, lst.size()); DropMessage dropMessage = lst.get(0).dropMessage; assertEquals("msg2", TextMessage.fromJson(dropMessage.getDropPayload()).getText()); }
void sendDropMessage(Contact c, String text) throws QblDropPayloadSizeException, QblNetworkInvalidResponseException, PersistenceException { text = EmojiParser.parseToUnicode(text); DropMessage d = new DropMessage(identity, new TextMessage(text).toJson(), DropMessageRepository.PAYLOAD_TYPE_MESSAGE); d.setDropMessageMetadata(new DropMessageMetadata(identity)); dropConnector.send(c, d); dropMessageRepository.addMessage(d, identity, c, true); }
ActionlogController extends AbstractController implements Initializable, Observer { void sendDropMessage(Contact c, String text) throws QblDropPayloadSizeException, QblNetworkInvalidResponseException, PersistenceException { text = EmojiParser.parseToUnicode(text); DropMessage d = new DropMessage(identity, new TextMessage(text).toJson(), DropMessageRepository.PAYLOAD_TYPE_MESSAGE); d.setDropMessageMetadata(new DropMessageMetadata(identity)); dropConnector.send(c, d); dropMessageRepository.addMessage(d, identity, c, true); } }
ActionlogController extends AbstractController implements Initializable, Observer { void sendDropMessage(Contact c, String text) throws QblDropPayloadSizeException, QblNetworkInvalidResponseException, PersistenceException { text = EmojiParser.parseToUnicode(text); DropMessage d = new DropMessage(identity, new TextMessage(text).toJson(), DropMessageRepository.PAYLOAD_TYPE_MESSAGE); d.setDropMessageMetadata(new DropMessageMetadata(identity)); dropConnector.send(c, d); dropMessageRepository.addMessage(d, identity, c, true); }  }
ActionlogController extends AbstractController implements Initializable, Observer { void sendDropMessage(Contact c, String text) throws QblDropPayloadSizeException, QblNetworkInvalidResponseException, PersistenceException { text = EmojiParser.parseToUnicode(text); DropMessage d = new DropMessage(identity, new TextMessage(text).toJson(), DropMessageRepository.PAYLOAD_TYPE_MESSAGE); d.setDropMessageMetadata(new DropMessageMetadata(identity)); dropConnector.send(c, d); dropMessageRepository.addMessage(d, identity, c, true); }  @Override void initialize(URL location, ResourceBundle resources); List<PersistenceDropMessage> getReceivedDropMessages(); @Override synchronized void update(Observable o, Object arg); synchronized void setContact(Contact contact); void handleAccept(); void handleIgnore(); void selectEmoji(); }
ActionlogController extends AbstractController implements Initializable, Observer { void sendDropMessage(Contact c, String text) throws QblDropPayloadSizeException, QblNetworkInvalidResponseException, PersistenceException { text = EmojiParser.parseToUnicode(text); DropMessage d = new DropMessage(identity, new TextMessage(text).toJson(), DropMessageRepository.PAYLOAD_TYPE_MESSAGE); d.setDropMessageMetadata(new DropMessageMetadata(identity)); dropConnector.send(c, d); dropMessageRepository.addMessage(d, identity, c, true); }  @Override void initialize(URL location, ResourceBundle resources); List<PersistenceDropMessage> getReceivedDropMessages(); @Override synchronized void update(Observable o, Object arg); synchronized void setContact(Contact contact); void handleAccept(); void handleIgnore(); void selectEmoji(); @FXML
    public BorderPane chat; @FXML
    public ImageView emojiSelector; }