Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enter code here
- Application
- -app-web-module
- -src/java/com/org/SpringApplicationClass
- -pom.xml
- -app-web-unitcases
- -src/test/com/org/mytestclass
- -pom.xml
- @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
- @AutoConfigureWebTestClient
- @TestInstance(TestInstance.Lifecycle.PER_CLASS)
- @ContextConfiguration(classes = com.org.MainApplication.class)
- public class BaseACTest {
- @Autowired
- private WebTestClient webTestClient;
- @BeforeAll
- public void init1() {
- MockitoAnnotations.initMocks(this);
- }
- @BeforeEach
- public void init() {
- Assertions.assertNotNull(webTestClient);
- }
- @Test
- public void testGetAllAmenities() {
- webTestClient.get().uri("/urltobeplaced/1234")
- .header("X-Request-ID", "123")
- .header("X-Session-ID", "123")
- .header("X-Application-ID", "123")
- .exchange()
- .expectStatus().isOk();
- }
- }```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement