From b23ee38082698ad711361fb9dd25465e647efb83 Mon Sep 17 00:00:00 2001 From: Severin Rudie Date: Wed, 8 Jan 2020 17:12:18 -0800 Subject: [PATCH] For #7556: fix intermittent failure in BookmarkNodeTest --- .../org/mozilla/fenix/ext/BookmarkNodeTest.kt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/test/java/org/mozilla/fenix/ext/BookmarkNodeTest.kt b/app/src/test/java/org/mozilla/fenix/ext/BookmarkNodeTest.kt index 60769ae20..5f291061a 100644 --- a/app/src/test/java/org/mozilla/fenix/ext/BookmarkNodeTest.kt +++ b/app/src/test/java/org/mozilla/fenix/ext/BookmarkNodeTest.kt @@ -4,18 +4,11 @@ package org.mozilla.fenix.ext -import org.junit.Assert.assertEquals -import org.junit.Test -import org.junit.runner.RunWith -import org.mozilla.fenix.TestApplication -import org.robolectric.RobolectricTestRunner -import org.robolectric.annotation.Config import mozilla.components.concept.storage.BookmarkNode import mozilla.components.concept.storage.BookmarkNodeType -import java.util.UUID +import org.junit.Assert.assertEquals +import org.junit.Test -@RunWith(RobolectricTestRunner::class) -@Config(application = TestApplication::class) class BookmarkNodeTest { private val bookmarkChild1 = newBookmarkNode("Child 1", 1, null) @@ -23,6 +16,8 @@ class BookmarkNodeTest { private val bookmarkChild3 = newBookmarkNode("Child 3", 3, null) private val allChildren = listOf(bookmarkChild1, bookmarkChild2) + private var uniqueId = 0 + @Test fun `GIVEN a bookmark node with children WHEN minusing a sub set of children THEN the children subset is removed and rest remains`() { val bookmarkNode = newBookmarkNode("Parent 1", 0, allChildren) @@ -85,7 +80,7 @@ class BookmarkNodeTest { private fun newBookmarkNode(title: String, position: Int, children: List?) = BookmarkNode( type = BookmarkNodeType.ITEM, - guid = UUID.randomUUID().toString(), + guid = uniqueId++.toString(), parentGuid = "12", position = position, title = title,