package com.thoughtworks.fam.resource;

import org.aspectj.lang.annotation.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MockMvcBuilder;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

public class AssetsControllerTest
{
    @InjectMocks
    private AssetsController assetController;
    private MockMvc mockMvc ;

    @Test
    public void should_return_201_when_create_assets_sucess() throws Exception
    {
        MockitoAnnotations.initMocks(this);
        mockMvc=MockMvcBuilders.standaloneSetup(assetController).build();

        this.mockMvc.perform(post("/asset")
                .contentType(MediaType.APPLICATION_JSON)
                .content("{name:\"17001176\",type:\"Apple Laptop\"}"))
                .andExpect(status().isCreated());
    }

}

@@ -37,51 +37,8 @@
 e;%0A%0A
-import org.aspectj.lang.annotation.Before;%0A
 impo
@@ -227,68 +227,8 @@
 vc;%0A
-import org.springframework.test.web.servlet.MockMvcBuilder;%0A
 impo
@@ -664,16 +664,17 @@
 sets_suc
+c
 ess() th

rename test