{"action":"opened","issue":{"url":"https://api.github.com/repos/graphql-java/graphql-spring-boot/issues/82","repository_url":"https://api.github.com/repos/graphql-java/graphql-spring-boot","labels_url":"https://api.github.com/repos/graphql-java/graphql-spring-boot/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/graphql-java/graphql-spring-boot/issues/82/comments","events_url":"https://api.github.com/repos/graphql-java/graphql-spring-boot/issues/82/events","html_url":"https://github.com/graphql-java/graphql-spring-boot/issues/82","id":327038852,"number":82,"title":"Integration Test fails, /graphql enpoint not found","user":{"login":"gigo1980","id":2462953,"avatar_url":"https://avatars3.githubusercontent.com/u/2462953?v=4","gravatar_id":"","url":"https://api.github.com/users/gigo1980","html_url":"https://github.com/gigo1980","followers_url":"https://api.github.com/users/gigo1980/followers","following_url":"https://api.github.com/users/gigo1980/following{/other_user}","gists_url":"https://api.github.com/users/gigo1980/gists{/gist_id}","starred_url":"https://api.github.com/users/gigo1980/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gigo1980/subscriptions","organizations_url":"https://api.github.com/users/gigo1980/orgs","repos_url":"https://api.github.com/users/gigo1980/repos","events_url":"https://api.github.com/users/gigo1980/events{/privacy}","received_events_url":"https://api.github.com/users/gigo1980/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-28T14:08:12Z","updated_at":"2018-05-28T14:08:12Z","closed_at":null,"author_association":"NONE","body":"If i try to execute an integration test the graphql endpoint is not found, the test returns a \"404\"\r\n\r\n```java\r\nRunWith(SpringRunner.class)\r\n@SpringBootTest(\r\n        webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)\r\n@AutoConfigureMockMvc\r\n@EnableConfigurationProperties(GraphQLServletProperties.class)\r\n@TestPropertySource(\r\n        locations = \"classpath:application-integrationtest.yaml\")\r\npublic class GraphQlControllerTest {\r\n\r\n\r\n    @Autowired\r\n    private MockMvc mvc;\r\n\r\n\r\n    @Test\r\n    public void myTests() throws Exception {\r\n        String request = \"{\\\"query\\\": \\\"query{groups{id}}\\\", \\\"variables\\\": null}\";\r\n        ResultActions response = mvc.perform(post(\"/graphql\").content(request).contentType(MediaType.APPLICATION_JSON));\r\n\r\n        response.andExpect(status().isOk());\r\n    }\r\n}\r\n```\r\n\r\noutput of the test is:\r\n```\r\nMockHttpServletRequest:\r\n      HTTP Method = POST\r\n      Request URI = /graphql\r\n       Parameters = {}\r\n          Headers = {Content-Type=[application/json;charset=UTF-8]}\r\n\r\nHandler:\r\n             Type = org.springframework.web.servlet.resource.ResourceHttpRequestHandler\r\n\r\nAsync:\r\n    Async started = false\r\n     Async result = null\r\n\r\nResolved Exception:\r\n             Type = null\r\n\r\nModelAndView:\r\n        View name = null\r\n             View = null\r\n            Model = null\r\n\r\nFlashMap:\r\n       Attributes = null\r\n\r\nMockHttpServletResponse:\r\n           Status = 404\r\n    Error message = null\r\n          Headers = {}\r\n     Content type = null\r\n             Body = \r\n    Forwarded URL = null\r\n   Redirected URL = null\r\n          Cookies = []\r\n\r\njava.lang.AssertionError: Status \r\nExpected :200\r\nActual   :404\r\n```\r\n\r\nhas anyone an working example for writing integration tests?"}}
{"actor":{"display_login":"gigo1980"}}