Showing with 6 additions and 1 deletion.
  1. +1 −0 src/plugins/WebOfTrust/Identity.java
  2. +5 −1 test/plugins/WebOfTrust/IdentityTest.java
@@ -1265,6 +1265,7 @@ public Identity clone() {
clone.setNewEditionHint(getLatestEditionHint());
clone.setCreationDate(getCreationDate());
clone.mCurrentEditionFetchState = getCurrentEditionFetchState();
clone.mLastFetchedDate = (Date)mLastFetchedDate.clone();
clone.mLatestEditionHint = getLatestEditionHint(); // Don't use the setter since it won't lower the current edition hint.
clone.setContexts(getContexts());
clone.setProperties(getProperties());
@@ -73,7 +73,11 @@ protected void setUp() throws Exception {
*/
public void testClone() throws MalformedURLException, InvalidParameterException, IllegalArgumentException, IllegalAccessException, InterruptedException {
final Identity original = new Identity(mWoT, getRandomSSKPair()[1], getRandomLatinString(Identity.MAX_NICKNAME_LENGTH), true);
original.setEdition(10); // Make sure to use a non-default edition

waitUntilCurrentTimeUTCIsAfter(original.getCreationDate());
original.onFetchedAndParsedSuccessfully(10);
assertTrue(original.getLastFetchedDate().after(original.getCreationDate()));

original.setNewEditionHint(20); // Make sure to use a non-default edition hint
original.addContext(getRandomLatinString(Identity.MAX_CONTEXT_NAME_LENGTH));
original.setProperty(getRandomLatinString(Identity.MAX_PROPERTY_NAME_LENGTH),