Skip to content

Commit 4c9de42

Browse files
committed
fix: ParseUriHttpBodyTest.testInitializeWithUri and ParseUriHttpBodyTest.testWriteTo
1 parent e0fbb52 commit 4c9de42

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: parse/src/test/java/com/parse/ParseUriHttpBodyTest.java

+22
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,39 @@
1111
import static org.junit.Assert.assertArrayEquals;
1212
import static org.junit.Assert.assertEquals;
1313

14+
import android.content.Context;
1415
import android.net.Uri;
16+
import androidx.test.platform.app.InstrumentationRegistry;
1517
import java.io.ByteArrayOutputStream;
1618
import java.io.File;
1719
import java.io.IOException;
20+
import org.junit.After;
21+
import org.junit.Before;
1822
import org.junit.Rule;
1923
import org.junit.Test;
2024
import org.junit.rules.TemporaryFolder;
25+
import org.junit.runner.RunWith;
26+
import org.robolectric.RobolectricTestRunner;
2127

28+
@RunWith(RobolectricTestRunner.class)
2229
public class ParseUriHttpBodyTest {
2330
@Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder();
2431

32+
@Before
33+
public void setup() {
34+
Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
35+
Parse.initialize(
36+
new Parse.Configuration.Builder(context)
37+
.server("http://localhost:1337/parse")
38+
.applicationId("parse")
39+
.build());
40+
}
41+
42+
@After
43+
public void tearDown() {
44+
Parse.destroy();
45+
}
46+
2547
@Test
2648
public void testInitializeWithUri() throws IOException {
2749
byte[] content = {1, 1, 1, 1, 1};

0 commit comments

Comments
 (0)