本文整理汇总了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)
);
}
示例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);
}
示例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"));
}
示例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);
}
示例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();
}
示例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);
}
示例7: before
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void before() {
RestAssuredMockMvc.standaloneSetup(this.customerRestController);
}
示例8: setUp
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
RestAssuredMockMvc.webAppContextSetup(context);
}
示例9: setUp
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
RestAssuredMockMvc.standaloneSetup(userController);
}
示例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());
}
示例12: setup
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() throws UserNotFoundException {
RestAssuredMockMvc.standaloneSetup(new EditUserApiController(), new AuthUserApiController());
}
示例13: setUp
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setUp() {
RestAssuredMockMvc.webAppContextSetup(context);
}
示例14: setup
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() {
RestAssuredMockMvc.standaloneSetup(new IssuesController(issuesService()));
}
示例15: setup
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc; //导入依赖的package包/类
@Before
public void setup() {
RestAssuredMockMvc.standaloneSetup(new GreetingController());
}