package com.globo.clappr.base;

import android.content.Context;

import com.globo.clappr.BuildConfig;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;

import java.util.HashMap;
import java.util.Map;

@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21)
public class BaseObjectJavaTest {
    Context context;

    @Before
    public void setup() {
        context = BaseObject.Companion.getContext();
    }

    @After
    public void tearDown() {
        BaseObject.Companion.setContext(context);
    }

    @Test(expected=kotlin.KotlinNullPointerException.class)
    public void baseObjectWithoutContext() {
        BaseObject bo = new BaseObject();
    }

    @Test
    public void baseObjectCreation() {
        BaseObject.Companion.setContext(ShadowApplication.getInstance().getApplicationContext());
        BaseObject bo = new BaseObject();
    }

}

@@ -593,18 +593,8 @@
     
- context =
  Bas
@@ -611,17 +611,17 @@
 mpanion.
-g
+s
 etContex
@@ -626,105 +626,12 @@
 ext(
-);%0A    %7D%0A%0A    @After%0A    public void tearDown() %7B%0A        BaseObject.Companion.setContext(context
+null
 );%0A 

update java tests for new BaseObject context initialisation