本文整理汇总了Java中org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers类的典型用法代码示例。如果您正苦于以下问题:Java SecurityMockMvcConfigurers类的具体用法?Java SecurityMockMvcConfigurers怎么用?Java SecurityMockMvcConfigurers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityMockMvcConfigurers类属于org.springframework.security.test.web.servlet.setup包,在下文中一共展示了SecurityMockMvcConfigurers类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setup
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@BeforeClass
public void setup() {
// https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#test-mockmvc
// https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#web-app-security
// https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#filter-ordering
// http://projects.spring.io/spring-security-oauth/docs/oauth2.html
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).apply(SecurityMockMvcConfigurers.springSecurity())
.alwaysDo(print()).build();
}
开发者ID:eclipse,项目名称:keti,代码行数:10,代码来源:SecurityFilterChainTest.java
示例2: setup
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
//.alwaysDo(print())
.apply(SecurityMockMvcConfigurers.springSecurity())
.build();
}
开发者ID:MaritimeConnectivityPlatform,项目名称:IdentityRegistry,代码行数:9,代码来源:OrganizationControllerTests.java
示例3: setup
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Before
public void setup() {
this.mockMvc = MockMvcBuilders
.webAppContextSetup(this.wac)
.apply(SecurityMockMvcConfigurers.springSecurity())
.build();
}
开发者ID:UdL-EPS-SoftArch,项目名称:entsoftarch-1516-server,代码行数:8,代码来源:MyStepdefs.java
示例4: setUp
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac)
.apply(SecurityMockMvcConfigurers.springSecurity())
.build();
if (!setUpIsDone) {
createProposalWithTitleBy("Professor1 proposal", "professor1");
createProposalWithTitleBy("Student1 proposal", "student1");
setUpIsDone = true;
}
}
开发者ID:UdL-EPS-SoftArch,项目名称:entsoftarch-1516-server,代码行数:12,代码来源:ProposalRepositoryTest.java
示例5: setup
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
.alwaysDo(print())
.apply(SecurityMockMvcConfigurers.springSecurity())
.build();
if (!initialized) {
userRepository.create(new User("admin", Role.ROLE_ADMIN));
initialized = true;
FileSystemUtils.deleteRecursively(new File("target/RemoteApiController2Test"));
}
}
开发者ID:webanno,项目名称:webanno,代码行数:16,代码来源:RemoteApiController2Test.java
示例6: setUp
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Before
public void setUp() {
data.setDataId(existingId);
data.setDataValue(TEST_DATA);
List<Data> dataList = new ArrayList<>();
dataList.add(data);
when(dataService.findAll()).thenReturn(dataList);
when(dataService.findById(existingId)).thenReturn(data);
when(dataService.findById(nonExistingId)).thenReturn(null);
when(dataService.delete(existingId)).thenReturn(true);
when(dataService.delete(nonExistingId)).thenReturn(false);
when(dataService.create(any())).thenReturn(data);
sut = MockMvcBuilders.standaloneSetup(dataController)
.apply(SecurityMockMvcConfigurers.springSecurity(springSecurityFilterChain)).build();
}
开发者ID:lcappuccio,项目名称:h2-embedded,代码行数:16,代码来源:DataControllerTest.java
示例7: setUp
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Before
public void setUp() {
sut = MockMvcBuilders.standaloneSetup(restController)
.apply(SecurityMockMvcConfigurers.springSecurity(springSecurityFilterChain)).build();
}
开发者ID:lcappuccio,项目名称:filtering-ads-with-linux,代码行数:6,代码来源:RestControllerTest.java
示例8: setUp
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Before
public void setUp() {
sut = MockMvcBuilders.webAppContextSetup(wac)
.apply(SecurityMockMvcConfigurers.springSecurity(springSecurityFilterChain)).build();
}
开发者ID:lcappuccio,项目名称:filtering-ads-with-linux,代码行数:6,代码来源:ViewControllerTest.java
示例9: setup
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Before
public void setup() {
mvc = MockMvcBuilders.webAppContextSetup(context)
.apply(SecurityMockMvcConfigurers.springSecurity())
.build();
}
开发者ID:cs71-caffeine,项目名称:awesome-agile,代码行数:7,代码来源:BasicSecurityConfigTest.java
示例10: buildMockMvc
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; //导入依赖的package包/类
@Override
protected MockMvc buildMockMvc(){
return MockMvcBuilders.webAppContextSetup(webApplicationContext)
.apply(SecurityMockMvcConfigurers.springSecurity())
.build();
}
开发者ID:wayshall,项目名称:onetwo,代码行数:7,代码来源:BootMvcWithSecurityBaseITest.java
注:本文中的org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论