Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Jan 10, 2025
1 parent 5ac6fb6 commit 9852e36
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.microsphere.spring.webmvc.annotation;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

/**
* {@link EnableWebMvcExtension} Test with defaults
*
* @author <a href="mailto:[email protected]">Mercy<a/>
* @see EnableWebMvcExtension
* @since 1.0.0
*/
@RunWith(SpringRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = {
EnableWebMvcExtensionDefaultTest.class
})
@EnableWebMvc
@EnableWebMvcExtension
public class EnableWebMvcExtensionDefaultTest {

@Autowired
private WebApplicationContext wac;

private MockMvc mockMvc;

@Before
public void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
}

@Test
public void test() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@
*/
package io.microsphere.spring.webmvc.annotation;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

/**
* {@link EnableWebMvcExtension} Test
Expand All @@ -34,13 +40,24 @@
@ContextConfiguration(classes = {
EnableWebMvcExtensionTest.class
})
@EnableWebMvc
@EnableWebMvcExtension(
registerHandlerInterceptors = true,
storeRequestBodyArgument = true,
storeResponseBodyReturnValue = true
)
public class EnableWebMvcExtensionTest {

@Autowired
private WebApplicationContext wac;

private MockMvc mockMvc;

@Before
public void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
}

@Test
public void test() {

Expand Down

0 comments on commit 9852e36

Please sign in to comment.