当前位置: 首页>>代码示例>>Java>>正文


Java RestAssuredMockMvc类代码示例

本文整理汇总了Java中com.jayway.restassured.module.mockmvc.RestAssuredMockMvc的典型用法代码示例。如果您正苦于以下问题:Java RestAssuredMockMvc类的具体用法?Java RestAssuredMockMvc怎么用?Java RestAssuredMockMvc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RestAssuredMockMvc类属于com.jayway.restassured.module.mockmvc包,在下文中一共展示了RestAssuredMockMvc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() throws Exception {
    File tempFile = File.createTempFile("junit-healthchecks", "");
    tempFile.delete();

    healthCheckRepository = new JsonBackedHealthCheckRepositoryImpl(
            tempFile,

            new ObjectMapper()
    );
    RestAssuredMockMvc.standaloneSetup(
            new HealthChecksController(healthCheckRepository)
    );
}
 
开发者ID:gilles-stragier,项目名称:quickmon,代码行数:15,代码来源:HealthChecksControllerIntegrationTest.java

示例2: before

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void before() {

    Mockito.when(this.customerRepository.findAll())
            .thenReturn(Arrays.asList(
                    new Customer(1L, "first1", "last1", "[email protected]"),
                    new Customer(2L, "first2", "last2", "[email protected]")));

    Mockito.when(this.customerRepository.findOne(Mockito.anyLong())).thenAnswer(invocation -> {
        Object id = invocation.getArguments()[0];
        return new Customer(Long.class.cast(id), "first", "last", "[email protected]");
    });

    RestAssuredMockMvc.standaloneSetup(this.customerRestController);
}
 
开发者ID:applied-continuous-delivery-livelessons,项目名称:cdct,代码行数:16,代码来源:CustomerBase.java

示例3: before

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void before() {
    RestAssuredMockMvc.standaloneSetup(this.customerRestController);

    Mockito.when(this.customerRepository.findOne(1L))
            .thenReturn(new Customer(1L, "first", "last", "email"));

}
 
开发者ID:applied-continuous-delivery-livelessons,项目名称:cdct,代码行数:9,代码来源:BaseClass.java

示例4: setUp

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    VehicleDetail i = new VehicleDetail();
    i.setVin("WDC1660631A7506890");
    i.setOwner("James 王");
    i.setBrand("Audi X5");
    i.setRegisteredDate(new Date(1502347667000L));
    i.setMileage(1200);
    RestAssuredMockMvc.webAppContextSetup(context);

    given(vehicleService.getVehicle("WDC1660631A7506890")).willReturn(i);
}
 
开发者ID:soleverlee,项目名称:spring-contract-example,代码行数:13,代码来源:VehicleBase.java

示例5: setUp

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
/**
 * Before each Test perform Mock Reset Assured Setup...
 *
 * @throws Exception
 */
@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    RestAssuredMockMvc.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
    RestAssuredMockMvc.enableLoggingOfRequestAndResponseIfValidationFails();
}
 
开发者ID:jaschenk,项目名称:Your-Microservice,代码行数:12,代码来源:ExampleClientIntegrationIT.java

示例6: setup

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() {
	mockMvcBuilder = standaloneSetup(new FooController(mock(EntityLinks.class)));
	DefaultFormattingConversionService service = new DefaultFormattingConversionService();
	service.addConverter(new StringToUuidConverter());
	mockMvcBuilder.setMessageConverters(jackson2HttpMessageConverter()).setConversionService(service);
	RestAssuredMockMvc.standaloneSetup(mockMvcBuilder);
}
 
开发者ID:Devskiller,项目名称:friendly-id,代码行数:9,代码来源:MvcTest.java

示例7: before

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void before() {
    RestAssuredMockMvc.standaloneSetup(this.customerRestController);
}
 
开发者ID:applied-continuous-delivery-livelessons,项目名称:cdct,代码行数:5,代码来源:CustomerBase.java

示例8: setUp

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	RestAssuredMockMvc.webAppContextSetup(context);
}
 
开发者ID:anilallewar,项目名称:microservices-basics-spring-boot,代码行数:5,代码来源:TaskCommentsBase.java

示例9: setUp

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    RestAssuredMockMvc.standaloneSetup(userController);
}
 
开发者ID:kchrusciel,项目名称:Spring-Boot-Examples,代码行数:5,代码来源:BaseClass.java

示例10: setUp

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setUp() {
    RestAssuredMockMvc.standaloneSetup(new ProductController());
}
 
开发者ID:nt-ca-aqe,项目名称:blog-contract-testing-with-spring-cloud-contract,代码行数:5,代码来源:ContractVerifierBaseTest.java

示例11: setup

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() {
	dao.insert(TestDataFactory.getSimpleTestNotes());
	archivedDao.insert(TestDataFactory.getSimpleTestArchivedNotes());
	RestAssuredMockMvc.mockMvc(webAppContextSetup(webApplicationContext).build());
}
 
开发者ID:daflockinger,项目名称:poppynotes,代码行数:7,代码来源:BaseContractTest.java

示例12: setup

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() throws UserNotFoundException {
	RestAssuredMockMvc.standaloneSetup(new EditUserApiController(), new AuthUserApiController());
}
 
开发者ID:daflockinger,项目名称:poppynotes,代码行数:5,代码来源:BaseContractTest.java

示例13: setUp

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setUp() {
	RestAssuredMockMvc.webAppContextSetup(context);
}
 
开发者ID:Devskiller,项目名称:friendly-id,代码行数:5,代码来源:ContractVerifierBase.java

示例14: setup

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() {
	RestAssuredMockMvc.standaloneSetup(new IssuesController(issuesService()));
}
 
开发者ID:spring-cloud-samples,项目名称:github-analytics,代码行数:5,代码来源:BaseClass.java

示例15: setup

import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() {
    RestAssuredMockMvc.standaloneSetup(new GreetingController());
}
 
开发者ID:Codearte,项目名称:accurest-maven-plugin,代码行数:5,代码来源:BaseAccurest.java


注:本文中的com.jayway.restassured.module.mockmvc.RestAssuredMockMvc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。