|
| 1 | +/* |
| 2 | + * |
| 3 | + * * |
| 4 | + * * * |
| 5 | + * * * * Copyright 2019-2020 the original author or authors. |
| 6 | + * * * * |
| 7 | + * * * * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * * * * you may not use this file except in compliance with the License. |
| 9 | + * * * * You may obtain a copy of the License at |
| 10 | + * * * * |
| 11 | + * * * * https://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * * * * |
| 13 | + * * * * Unless required by applicable law or agreed to in writing, software |
| 14 | + * * * * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * * * * See the License for the specific language governing permissions and |
| 17 | + * * * * limitations under the License. |
| 18 | + * * * |
| 19 | + * * |
| 20 | + * |
| 21 | + * |
| 22 | + */ |
| 23 | +package test.org.springdoc.api.app127; |
| 24 | + |
| 25 | +import org.junit.Assert; |
| 26 | +import org.junit.jupiter.api.Test; |
| 27 | +import org.springdoc.core.Constants; |
| 28 | +import test.org.springdoc.api.AbstractSpringDocTest; |
| 29 | + |
| 30 | +import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 31 | +import org.springframework.test.web.servlet.MvcResult; |
| 32 | + |
| 33 | +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; |
| 34 | +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; |
| 35 | + |
| 36 | + |
| 37 | +/** |
| 38 | + * Tests Spring meta-annotations as method parameters |
| 39 | + */ |
| 40 | +public class SpringDocApp127Test extends AbstractSpringDocTest { |
| 41 | + |
| 42 | + @SpringBootApplication |
| 43 | + static class SpringDocTestApp {} |
| 44 | + |
| 45 | + @Test |
| 46 | + public void testApp() throws Exception { |
| 47 | + className = getClass().getSimpleName(); |
| 48 | + String testNumber = className.replaceAll("[^0-9]", ""); |
| 49 | + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL+".yaml")).andExpect(status().isOk()).andReturn(); |
| 50 | + String result = mockMvcResult.getResponse().getContentAsString(); |
| 51 | + Assert.assertTrue(!result.contains("!<Type A>")); |
| 52 | + } |
| 53 | +} |
0 commit comments