BAEL-4642: Open API Server Implementation using OpenAPI Generator (#10598)

* BAEL-4642: Open API Server Implementation using OpenAPI Generator

* BAEL-4642: Open API Server Implementation using OpenAPI Generator

* BAEL-4642
This commit is contained in:
freelansam
2021-03-28 23:00:44 +05:30
committed by GitHub
parent b7cbb5428d
commit 945753e5dc
5 changed files with 207 additions and 1 deletions
@@ -10,6 +10,8 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.JobRunrSpringBootApp;
import java.net.URI;
import java.util.concurrent.TimeUnit;
@@ -0,0 +1,33 @@
package com.baeldung.openapi;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public class OpenApiPetsIntegrationTest {
private static final String PETS_PATH = "/pets/";
@Autowired
private MockMvc mockMvc;
@Test
public void whenReadAll_thenStatusIsNotImplemented() throws Exception {
this.mockMvc.perform(get(PETS_PATH)).andExpect(status().isNotImplemented());
}
@Test
public void whenReadOne_thenStatusIsNotImplemented() throws Exception {
this.mockMvc.perform(get(PETS_PATH + 1)).andExpect(status().isNotImplemented());
}
}