<commit_before>package tokyo.tommy_kw.kotlinsample.test.entity

import android.support.test.runner.AndroidJUnit4
import com.google.gson.Gson
import org.hamcrest.CoreMatchers
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations

/**
 * Created by tommy on 15/10/09.
 */
@RunWith(AndroidJUnit4::class)
class WeatherTest {
    private var jsonString = "{\"coord\":{\"lon\":139.69,\"lat\":35.69},\"weather\":[{\"id\":800,\"main\":\"Clear\",\"description\":\"Sky is Clear\",\"icon\":\"01n\"}],\"base\":\"stations\",\"main\":{\"temp\":290.05,\"pressure\":1005,\"humidity\":42,\"temp_min\":286.15,\"temp_max\":295.37},\"visibility\":10000,\"wind\":{\"speed\":4.1,\"deg\":280},\"clouds\":{\"all\":0},\"dt\":1444343823,\"sys\":{\"type\":1,\"id\":7619,\"message\":0.0171,\"country\":\"JP\",\"sunrise\":1444250515,\"sunset\":1444292098},\"id\":1850147,\"name\":\"Tokyo\",\"cod\":200}"

    // Property must be initialized...
    // @Mock
    // var gson: Gson

    @Before
    fun setUp() {
        var json = Gson().fromJson(jsonString, Weather::class.java)
        MockitoAnnotations.initMocks(this)
        //Mockito.`when`(json.coord.lon).thenReturn(139.69)
        //Mockito.`when`(json.coord.lat).thenReturn(35.69)
        `when`(json.weathers[0].id).thenReturn(800)<commit_msg>Fixed test<commit_after>package tokyo.tommy_kw.kotlinsample.test.entity

import android.support.test.runner.AndroidJUnit4
import com.google.gson.Gson
import org.hamcrest.CoreMatchers
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
import tokyo.tommy_kw.kotlinsample.entity.Weather

/**
 * Created by tommy on 15/10/09.
 */
@RunWith(AndroidJUnit4::class)
class WeatherTest {
    private var jsonString = "{\"coord\":{\"lon\":139.69,\"lat\":35.69},\"weather\":[{\"id\":800,\"main\":\"Clear\",\"description\":\"Sky is Clear\",\"icon\":\"01n\"}],\"base\":\"stations\",\"main\":{\"temp\":290.05,\"pressure\":1005,\"humidity\":42,\"temp_min\":286.15,\"temp_max\":295.37},\"visibility\":10000,\"wind\":{\"speed\":4.1,\"deg\":280},\"clouds\":{\"all\":0},\"dt\":1444343823,\"sys\":{\"type\":1,\"id\":7619,\"message\":0.0171,\"country\":\"JP\",\"sunrise\":1444250515,\"sunset\":1444292098},\"id\":1850147,\"name\":\"Tokyo\",\"cod\":200}"

    // Property must be initialized...
    // @Mock
    // var gson: Gson

    @Before
    fun setUp() {
        var json = Gson().fromJson(jsonString, Weather::class.java)
        MockitoAnnotations.initMocks(this)
        //Mockito.`when`(json.coord.lon).thenReturn(139.69)
        //Mockito.`when`(json.coord.lat).thenReturn(35.69)
        `when`(json.weathers[0].id).thenReturn(800)
{'fraction_non_alphanumeric': 0.24620811287477953, 'fraction_numerical': 0.08253968253968254, 'mean_word_length': 4.064285714285714, 'pattern_counts': {'":': 64, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2500421', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1020, 'n_words': 108}