diff --git a/parse/src/test/java/com/parse/ParseUriHttpBodyTest.java b/parse/src/test/java/com/parse/ParseUriHttpBodyTest.java index 8e472195..2aa345d3 100644 --- a/parse/src/test/java/com/parse/ParseUriHttpBodyTest.java +++ b/parse/src/test/java/com/parse/ParseUriHttpBodyTest.java @@ -11,17 +11,39 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; +import android.content.Context; import android.net.Uri; +import androidx.test.platform.app.InstrumentationRegistry; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; +import org.junit.After; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; +@RunWith(RobolectricTestRunner.class) public class ParseUriHttpBodyTest { @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder(); + @Before + public void setup() { + Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); + Parse.initialize( + new Parse.Configuration.Builder(context) + .server("http://localhost:1337/parse") + .applicationId("parse") + .build()); + } + + @After + public void tearDown() { + Parse.destroy(); + } + @Test public void testInitializeWithUri() throws IOException { byte[] content = {1, 1, 1, 1, 1};