@@ -22,46 +22,36 @@ private List<TagObject> getTagsForPath(DbxClientV2 client, String dropboxPath) t
2222 assertEquals (1 , pathToTags .size ()); // There is only one path (the one we asked for)
2323 PathToTags pathToTag = pathToTags .get (0 );
2424 assertEquals (dropboxPath , pathToTag .getPath ()); // This is the path we are looking for
25- System .out .println ("Path to Tags: " + pathToTag .getTags ());
2625 return pathToTag .getTags ();
2726 }
2827
2928 @ Test
3029 public void testTagging () throws Exception {
3130 DbxClientV2 client = ITUtil .newClientV2 ();
3231
33- int randomInt = new Random ().nextInt ();
34-
35-
36- byte [] contents = ("Tagging Test " + randomInt ).getBytes ();
37- String dropboxPath = ITUtil .path (getClass (), "/tagging-test-" + randomInt + ".txt" );
32+ byte [] contents = ("Tagging Test" ).getBytes ();
33+ String dropboxPath = ITUtil .path (getClass (), "/tagging-test.txt" );
3834
3935 // Upload File
4036 client .files ().uploadBuilder (dropboxPath )
4137 .withMode (WriteMode .OVERWRITE )
4238 .uploadAndFinish (new ByteArrayInputStream (contents ));
39+ Thread .sleep (1000 );
4340
4441 // Add Tag "a" to file
4542 client .files ().tagsAdd (dropboxPath , "a" );
46- assertEquals ("a" , getTagsForPath (client , dropboxPath ).get (0 ).getUserGeneratedTagValue ().getTagText ());
43+ Thread .sleep (1000 );
44+
45+ List <TagObject > tagsWithA = getTagsForPath (client , dropboxPath );
46+ assertEquals ("a" , tagsWithA .get (0 ).getUserGeneratedTagValue ().getTagText ());
47+ Thread .sleep (1000 );
4748
48- // Add Tag "b" to file
49- client .files ().tagsAdd (dropboxPath , "b" );
50- List <TagObject > tagsAandB = getTagsForPath (client , dropboxPath );
51- assertEquals (2 , tagsAandB .size ());
52- assertEquals ("a" , tagsAandB .get (0 ).getUserGeneratedTagValue ().getTagText ());
53- assertEquals ("b" , tagsAandB .get (1 ).getUserGeneratedTagValue ().getTagText ());
5449
5550 // Remove Tag "a" from file
5651 client .files ().tagsRemove (dropboxPath , "a" );
57- List <TagObject > tagsJustB = getTagsForPath (client , dropboxPath );
58- assertEquals (1 , tagsJustB .size ());
59- assertEquals ("b" , tagsJustB .get (0 ).getUserGeneratedTagValue ().getTagText ());
60-
61- // Remove Tag "b" from file
62- client .files ().tagsRemove (dropboxPath , "b" );
6352 List <TagObject > tagsNone = getTagsForPath (client , dropboxPath );
6453 assertEquals (0 , tagsNone .size ());
54+ Thread .sleep (1000 );
6555
6656 // Cleanup, delete our test directory.
6757 client .files ().deleteV2 (dropboxPath );
0 commit comments