5353import org .junit .BeforeClass ;
5454import org .junit .Rule ;
5555import org .junit .Test ;
56+ import org .junit .runner .RunWith ;
5657
5758import java .io .File ;
5859import java .io .IOException ;
6162import java .util .List ;
6263import java .util .Random ;
6364
65+ import androidx .test .ext .junit .runners .AndroidJUnit4 ;
66+
6467import static com .owncloud .android .lib .resources .status .OwnCloudVersion .nextcloud_19 ;
6568import static junit .framework .TestCase .assertEquals ;
6669import static junit .framework .TestCase .assertFalse ;
6770import static junit .framework .TestCase .assertNotNull ;
6871import static junit .framework .TestCase .assertTrue ;
6972import static org .junit .Assume .assumeTrue ;
7073
74+ @ RunWith (AndroidJUnit4 .class )
7175public class EndToEndRandomIT extends AbstractOnServerIT {
7276 public enum Action {
7377 CREATE_FOLDER ,
@@ -88,8 +92,9 @@ public enum Action {
8892 public RetryTestRule retryTestRule = new RetryTestRule ();
8993
9094 @ BeforeClass
91- public static void initClass () {
95+ public static void initClass () throws Exception {
9296 arbitraryDataProvider = new ArbitraryDataProvider (targetContext .getContentResolver ());
97+ createKeys ();
9398 }
9499
95100 @ Before
@@ -511,7 +516,6 @@ public void reInit() throws Exception {
511516 encFolder .setEncrypted (true );
512517 getStorageManager ().saveFolder (encFolder , new ArrayList <>(), new ArrayList <>());
513518
514- createKeys ();
515519
516520 // delete keys
517521 arbitraryDataProvider .deleteKeyForAccount (account .name , EncryptionUtils .PRIVATE_KEY );
@@ -553,7 +557,7 @@ private void useExistingKeys() throws Exception {
553557 /*
554558 TODO do not c&p code
555559 */
556- private void createKeys () throws Exception {
560+ private static void createKeys () throws Exception {
557561 String publicKey ;
558562
559563 // Create public/private key pair
@@ -594,7 +598,7 @@ private void createKeys() throws Exception {
594598 }
595599 }
596600
597- private String generateMnemonicString () {
601+ private static String generateMnemonicString () {
598602 return "1 2 3 4 5 6" ;
599603 }
600604
0 commit comments