<commit_before>package umm3601.plant;

import com.google.gson.Gson;
import org.junit.Before;
import org.junit.Test;
import umm3601.digitalDisplayGarden.Plant;
import umm3601.digitalDisplayGarden.PlantController;
import umm3601.plant.PopulateMockDatabase;

import java.io.IOException;

import static junit.framework.TestCase.assertEquals;

public class FilterPlantsByGardenLocation {
    @Before
    public void setUpDB() throws IOException{
        PopulateMockDatabase mockDatabase = new PopulateMockDatabase();
        mockDatabase.clearAndPopulateDBAgain();
    }

    @Test
    public void findByGardenLocation() throws IOException {
        PlantController plantController = new PlantController();
        Plant[] filteredPlants;
        Gson gson = new Gson();

        String rawPlants = plantController.getGardenLocations();
        filteredPlants = gson.fromJson(rawPlants, Plant[].class);
        assertEquals("Incorrect", 1, filteredPlants.length);
    }
}<commit_msg>Add and pass tests for gardenLocation<commit_after>package umm3601.plant;

import com.google.gson.Gson;
import org.junit.Before;
import org.junit.Test;
import umm3601.digitalDisplayGarden.Plant;
import umm3601.digitalDisplayGarden.PlantController;
import umm3601.plant.PopulateMockDatabase;

import java.io.IOException;

import static junit.framework.TestCase.assertEquals;

public class FilterPlantsByGardenLocation {
    @Before
    public void setUpDB() throws IOException{
        PopulateMockDatabase mockDatabase = new PopulateMockDatabase();
        mockDatabase.clearAndPopulateDBAgain();
    }

    @Test
    public void findByGardenLocation() throws IOException {
        PlantController plantController = new PlantController();
        GardenLocation[] filteredPlants;
        Gson gson = new Gson();
        //System.out.println();
        String rawPlants = plantController.getGardenLocations();
        filteredPlants = gson.fromJson(rawPlants, GardenLocation[].class);
        assertEquals("Incorrect number of unique garden locations", 2, filteredPlants.length);
        assertEquals("Incorrect zero index", "10.0", filteredPlants[0]._id);
        assertEquals("Incorrect value for index 1", "7.0", filteredPlants[1]._id);
    }
}
{'fraction_non_alphanumeric': 0.09033707865168539, 'fraction_numerical': 0.01887640449438202, 'mean_word_length': 4.237647058823529, 'pattern_counts': {'":': 0, '<': 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': '6961661', 'n_tokens_mistral': 646, 'n_tokens_neox': 621, 'n_words': 139}