<commit_before>package com.thoughtworks.fam.web;

import com.thoughtworks.fam.service.UserAssetService;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

import static org.mockito.Mockito.mock;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

public class UserAssetControllerTest {

    private MockMvc mockMvc;

    @InjectMocks
    private UserAssetController userAssetController;

    private UserAssetService userAssetService;

    @Before
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        mockMvc = MockMvcBuilders.standaloneSetup(userAssetController).build();

        userAssetService = mock(UserAssetService.class);
        ReflectionTestUtils.setField(userAssetController, "userAssetService", userAssetService);

    }

    @Test
    public void should_access_to_get_user_assets() throws Exception {
        // when
        this.mockMvc.perform(get("/asset/<EMAIL>/list"))
                .andExpect(status().isOk());
    }

    @Test(expected = RuntimeException.class)
    public void should_get_runtime_exception() throws Exception {
        this.mockMvc.perform(get("/user//assets", null));
    }
}<commit_msg>[#0][Linesh] Remove comment.<commit_after>package com.thoughtworks.fam.web;

import com.thoughtworks.fam.service.UserAssetService;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

import static org.mockito.Mockito.mock;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

public class UserAssetControllerTest {

    private MockMvc mockMvc;

    @InjectMocks
    private UserAssetController userAssetController;

    private UserAssetService userAssetService;

    @Before
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        mockMvc = MockMvcBuilders.standaloneSetup(userAssetController).build();

        userAssetService = mock(UserAssetService.class);
        ReflectionTestUtils.setField(userAssetController, "userAssetService", userAssetService);

    }

    @Test
    public void should_access_to_get_user_assets() throws Exception {
        this.mockMvc.perform(get("/asset/<EMAIL>/list"))
                .andExpect(status().isOk());
    }

    @Test(expected = RuntimeException.class)
    public void should_get_runtime_exception() throws Exception {
        this.mockMvc.perform(get("/user//assets", null));
    }
}
{'fraction_non_alphanumeric': 0.09784979744468682, 'fraction_numerical': 0.0003116235587410408, 'mean_word_length': 4.572916666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6138118', 'n_tokens_mistral': 899, 'n_tokens_neox': 900, 'n_words': 149}