Search in sources :

Example 1 with MockRequest

use of com.arbindo.mimock.manage.mimocks.models.request.MockRequest in project mimock by arbindo.

the class MockManagementControllerTest method shouldReturnHttpBadRequest_CreateMockApi_WithInvalidParametersForHttpMethodInRequest_ReturnsValidationErrors.

@ParameterizedTest
@NullSource
@EmptySource
void shouldReturnHttpBadRequest_CreateMockApi_WithInvalidParametersForHttpMethodInRequest_ReturnsValidationErrors(String testData) throws Exception {
    // Arrange
    MockMultipartFile file = getMockMultipartFile();
    MockRequest mockRequest = createMockRequestWithFile(file);
    // Modify the MockRequest.HttpMethod to check
    mockRequest.setHttpMethod(testData);
    String route = UrlConfig.MOCKS_PATH;
    // Act and Assert
    mockMvc.perform(multipart(route).file(file).param("name", mockRequest.getName()).param("route", mockRequest.getRoute()).param("httpMethod", mockRequest.getHttpMethod()).param("responseContentType", mockRequest.getResponseContentType()).param("statusCode", String.valueOf(mockRequest.getStatusCode())).param("expectedTextResponse", mockRequest.getExpectedTextResponse()).param("description", mockRequest.getDescription())).andExpect(status().isBadRequest()).andExpect(response -> assertNotNull(response.getResolvedException())).andExpect(response -> assertTrue(response.getResolvedException().getMessage().contains("HttpMethod is required"))).andReturn();
}
Also used : MockMultipartFile(org.springframework.mock.web.MockMultipartFile) Messages(com.arbindo.mimock.common.constants.Messages) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) MockManagementService(com.arbindo.mimock.manage.mimocks.service.MockManagementService) GenericResponseWrapper(com.arbindo.mimock.common.wrapper.GenericResponseWrapper) UserDetailsService(org.springframework.security.core.userdetails.UserDetailsService) Autowired(org.springframework.beans.factory.annotation.Autowired) DatabaseStartupValidator(org.springframework.jdbc.support.DatabaseStartupValidator) ArrayList(java.util.ArrayList) MockMvc(org.springframework.test.web.servlet.MockMvc) DataSourceAutoConfiguration(org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration) DefaultHttpInterceptor(com.arbindo.mimock.interceptor.DefaultHttpInterceptor) EmptySource(org.junit.jupiter.params.provider.EmptySource) MvcResult(org.springframework.test.web.servlet.MvcResult) DataSource(javax.sql.DataSource) SecurityAutoConfiguration(org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration) Pageable(org.springframework.data.domain.Pageable) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) MockBean(org.springframework.boot.test.mock.mockito.MockBean) MocksGenerator(com.arbindo.mimock.helpers.entities.MocksGenerator) JpaRepositoriesAutoConfiguration(org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration) UrlConfig(com.arbindo.mimock.common.constants.UrlConfig) JwtRequestFilter(com.arbindo.mimock.security.JwtRequestFilter) EnableAutoConfiguration(org.springframework.boot.autoconfigure.EnableAutoConfiguration) Status(com.arbindo.mimock.manage.mimocks.enums.Status) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) UUID(java.util.UUID) MockMvcResultMatchers(org.springframework.test.web.servlet.result.MockMvcResultMatchers) Page(org.springframework.data.domain.Page) MockMvcRequestBuilders(org.springframework.test.web.servlet.request.MockMvcRequestBuilders) MockMultipartFile(org.springframework.mock.web.MockMultipartFile) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) Test(org.junit.jupiter.api.Test) HttpStatus(org.springframework.http.HttpStatus) Mockito(org.mockito.Mockito) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) List(java.util.List) AutoConfigureMockMvc(org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest) MockMultipartHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder) Assertions(org.junit.jupiter.api.Assertions) UserDetailsServiceAutoConfiguration(org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration) NullSource(org.junit.jupiter.params.provider.NullSource) Mock(com.arbindo.mimock.entities.Mock) PageImpl(org.springframework.data.domain.PageImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) EmptySource(org.junit.jupiter.params.provider.EmptySource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) NullSource(org.junit.jupiter.params.provider.NullSource)

Example 2 with MockRequest

use of com.arbindo.mimock.manage.mimocks.models.request.MockRequest in project mimock by arbindo.

the class MockManagementControllerTest method shouldReturnHttpBadRequest_CreateMockApi_WithInvalidParametersForStatusCodeInRequest_ReturnsValidationErrors.

@Test
void shouldReturnHttpBadRequest_CreateMockApi_WithInvalidParametersForStatusCodeInRequest_ReturnsValidationErrors() throws Exception {
    // Arrange
    MockMultipartFile file = getMockMultipartFile();
    MockRequest mockRequest = createMockRequestWithFile(file);
    String route = UrlConfig.MOCKS_PATH;
    // Act and Assert
    mockMvc.perform(multipart(route).file(file).param("name", mockRequest.getName()).param("route", mockRequest.getRoute()).param("httpMethod", mockRequest.getHttpMethod()).param("responseContentType", mockRequest.getResponseContentType()).param("expectedTextResponse", mockRequest.getExpectedTextResponse()).param("description", mockRequest.getDescription())).andExpect(status().isBadRequest()).andExpect(response -> assertNotNull(response.getResolvedException())).andExpect(response -> assertTrue(response.getResolvedException().getMessage().contains("statusCode"))).andReturn();
}
Also used : MockMultipartFile(org.springframework.mock.web.MockMultipartFile) Messages(com.arbindo.mimock.common.constants.Messages) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) MockManagementService(com.arbindo.mimock.manage.mimocks.service.MockManagementService) GenericResponseWrapper(com.arbindo.mimock.common.wrapper.GenericResponseWrapper) UserDetailsService(org.springframework.security.core.userdetails.UserDetailsService) Autowired(org.springframework.beans.factory.annotation.Autowired) DatabaseStartupValidator(org.springframework.jdbc.support.DatabaseStartupValidator) ArrayList(java.util.ArrayList) MockMvc(org.springframework.test.web.servlet.MockMvc) DataSourceAutoConfiguration(org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration) DefaultHttpInterceptor(com.arbindo.mimock.interceptor.DefaultHttpInterceptor) EmptySource(org.junit.jupiter.params.provider.EmptySource) MvcResult(org.springframework.test.web.servlet.MvcResult) DataSource(javax.sql.DataSource) SecurityAutoConfiguration(org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration) Pageable(org.springframework.data.domain.Pageable) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) MockBean(org.springframework.boot.test.mock.mockito.MockBean) MocksGenerator(com.arbindo.mimock.helpers.entities.MocksGenerator) JpaRepositoriesAutoConfiguration(org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration) UrlConfig(com.arbindo.mimock.common.constants.UrlConfig) JwtRequestFilter(com.arbindo.mimock.security.JwtRequestFilter) EnableAutoConfiguration(org.springframework.boot.autoconfigure.EnableAutoConfiguration) Status(com.arbindo.mimock.manage.mimocks.enums.Status) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) UUID(java.util.UUID) MockMvcResultMatchers(org.springframework.test.web.servlet.result.MockMvcResultMatchers) Page(org.springframework.data.domain.Page) MockMvcRequestBuilders(org.springframework.test.web.servlet.request.MockMvcRequestBuilders) MockMultipartFile(org.springframework.mock.web.MockMultipartFile) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) Test(org.junit.jupiter.api.Test) HttpStatus(org.springframework.http.HttpStatus) Mockito(org.mockito.Mockito) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) List(java.util.List) AutoConfigureMockMvc(org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest) MockMultipartHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder) Assertions(org.junit.jupiter.api.Assertions) UserDetailsServiceAutoConfiguration(org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration) NullSource(org.junit.jupiter.params.provider.NullSource) Mock(com.arbindo.mimock.entities.Mock) PageImpl(org.springframework.data.domain.PageImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)

Example 3 with MockRequest

use of com.arbindo.mimock.manage.mimocks.models.request.MockRequest in project mimock by arbindo.

the class MockManagementControllerTest method shouldReturnHttpBadRequest_CreateMockApi_WithInvalidParametersForRouteInRequest_ReturnsValidationErrors.

@ParameterizedTest
@NullSource
@EmptySource
void shouldReturnHttpBadRequest_CreateMockApi_WithInvalidParametersForRouteInRequest_ReturnsValidationErrors(String testData) throws Exception {
    // Arrange
    MockMultipartFile file = getMockMultipartFile();
    MockRequest mockRequest = createMockRequestWithFile(file);
    // Modify the MockRequest.Route to check
    mockRequest.setRoute(testData);
    String route = UrlConfig.MOCKS_PATH;
    // Act and Assert
    mockMvc.perform(multipart(route).file(file).param("name", mockRequest.getName()).param("route", mockRequest.getRoute()).param("httpMethod", mockRequest.getHttpMethod()).param("responseContentType", mockRequest.getResponseContentType()).param("statusCode", String.valueOf(mockRequest.getStatusCode())).param("expectedTextResponse", mockRequest.getExpectedTextResponse()).param("description", mockRequest.getDescription())).andExpect(status().isBadRequest()).andExpect(response -> assertNotNull(response.getResolvedException())).andExpect(response -> assertTrue(response.getResolvedException().getMessage().contains("Route is required"))).andReturn();
}
Also used : MockMultipartFile(org.springframework.mock.web.MockMultipartFile) Messages(com.arbindo.mimock.common.constants.Messages) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) MockManagementService(com.arbindo.mimock.manage.mimocks.service.MockManagementService) GenericResponseWrapper(com.arbindo.mimock.common.wrapper.GenericResponseWrapper) UserDetailsService(org.springframework.security.core.userdetails.UserDetailsService) Autowired(org.springframework.beans.factory.annotation.Autowired) DatabaseStartupValidator(org.springframework.jdbc.support.DatabaseStartupValidator) ArrayList(java.util.ArrayList) MockMvc(org.springframework.test.web.servlet.MockMvc) DataSourceAutoConfiguration(org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration) DefaultHttpInterceptor(com.arbindo.mimock.interceptor.DefaultHttpInterceptor) EmptySource(org.junit.jupiter.params.provider.EmptySource) MvcResult(org.springframework.test.web.servlet.MvcResult) DataSource(javax.sql.DataSource) SecurityAutoConfiguration(org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration) Pageable(org.springframework.data.domain.Pageable) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) MockBean(org.springframework.boot.test.mock.mockito.MockBean) MocksGenerator(com.arbindo.mimock.helpers.entities.MocksGenerator) JpaRepositoriesAutoConfiguration(org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration) UrlConfig(com.arbindo.mimock.common.constants.UrlConfig) JwtRequestFilter(com.arbindo.mimock.security.JwtRequestFilter) EnableAutoConfiguration(org.springframework.boot.autoconfigure.EnableAutoConfiguration) Status(com.arbindo.mimock.manage.mimocks.enums.Status) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) UUID(java.util.UUID) MockMvcResultMatchers(org.springframework.test.web.servlet.result.MockMvcResultMatchers) Page(org.springframework.data.domain.Page) MockMvcRequestBuilders(org.springframework.test.web.servlet.request.MockMvcRequestBuilders) MockMultipartFile(org.springframework.mock.web.MockMultipartFile) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) Test(org.junit.jupiter.api.Test) HttpStatus(org.springframework.http.HttpStatus) Mockito(org.mockito.Mockito) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) List(java.util.List) AutoConfigureMockMvc(org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest) MockMultipartHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder) Assertions(org.junit.jupiter.api.Assertions) UserDetailsServiceAutoConfiguration(org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration) NullSource(org.junit.jupiter.params.provider.NullSource) Mock(com.arbindo.mimock.entities.Mock) PageImpl(org.springframework.data.domain.PageImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) EmptySource(org.junit.jupiter.params.provider.EmptySource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) NullSource(org.junit.jupiter.params.provider.NullSource)

Example 4 with MockRequest

use of com.arbindo.mimock.manage.mimocks.models.request.MockRequest in project mimock by arbindo.

the class MockManagementControllerTest method shouldReturnHttpBadRequest_UpdateMockByIdApi_ReturnsNullMockData.

@Test
void shouldReturnHttpBadRequest_UpdateMockByIdApi_ReturnsNullMockData() throws Exception {
    // Arrange
    MockMultipartFile file = getMockMultipartFile();
    MockRequest mockRequest = createMockRequestWithFile(file);
    Mock mock = generateMock(mockRequest);
    String route = UrlConfig.MOCKS_PATH + "/" + mock.getId();
    lenient().when(mockManagementService.updateMock(anyString(), any(ProcessedMockRequest.class))).thenReturn(null);
    GenericResponseWrapper<Mock> genericResponseWrapper = getGenericResponseWrapper(HttpStatus.BAD_REQUEST, Messages.UPDATE_RESOURCE_FAILED, null);
    String expectedResponseBody = convertObjectToJsonString(genericResponseWrapper);
    String expectedContentType = "application/json";
    // Act
    MockMultipartHttpServletRequestBuilder builder = MockMvcRequestBuilders.multipart(route);
    builder.with(request -> {
        request.setMethod("PUT");
        return request;
    });
    MvcResult result = mockMvc.perform(builder.file(file).param("name", mockRequest.getName()).param("route", mockRequest.getRoute()).param("httpMethod", mockRequest.getHttpMethod()).param("responseContentType", mockRequest.getResponseContentType()).param("statusCode", String.valueOf(mockRequest.getStatusCode())).param("expectedTextResponse", mockRequest.getExpectedTextResponse()).param("description", mockRequest.getDescription())).andExpect(status().isBadRequest()).andExpect(content().contentType(expectedContentType)).andReturn();
    // Assert
    assertEquals(expectedResponseBody, result.getResponse().getContentAsString());
}
Also used : MockMultipartFile(org.springframework.mock.web.MockMultipartFile) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) MockMultipartHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) MvcResult(org.springframework.test.web.servlet.MvcResult) Mock(com.arbindo.mimock.entities.Mock) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)

Example 5 with MockRequest

use of com.arbindo.mimock.manage.mimocks.models.request.MockRequest in project mimock by arbindo.

the class MockManagementControllerTest method shouldReturnHttpBadRequest_CreateMockApi_WithInvalidParametersForDescriptionInRequest_ReturnsValidationErrors.

@Test
void shouldReturnHttpBadRequest_CreateMockApi_WithInvalidParametersForDescriptionInRequest_ReturnsValidationErrors() throws Exception {
    // Arrange
    MockMultipartFile file = getMockMultipartFile();
    MockRequest mockRequest = createMockRequestWithFile(file);
    // Modify the MockRequest.Description with empty value
    mockRequest.setDescription("");
    String route = UrlConfig.MOCKS_PATH;
    // Act and Assert
    mockMvc.perform(multipart(route).file(file).param("name", mockRequest.getName()).param("route", mockRequest.getRoute()).param("httpMethod", mockRequest.getHttpMethod()).param("responseContentType", mockRequest.getResponseContentType()).param("statusCode", String.valueOf(mockRequest.getStatusCode())).param("expectedTextResponse", mockRequest.getExpectedTextResponse()).param("description", mockRequest.getDescription())).andExpect(status().isBadRequest()).andExpect(response -> assertNotNull(response.getResolvedException())).andExpect(response -> assertTrue(response.getResolvedException().getMessage().contains("Description should be at least 1-250 characters"))).andReturn();
    // Modify the MockRequest.Description with longer value
    mockRequest.setDescription(generateRandomAlphabeticString(300));
    // Act and Assert
    mockMvc.perform(multipart(route).file(file).param("name", mockRequest.getName()).param("route", mockRequest.getRoute()).param("httpMethod", mockRequest.getHttpMethod()).param("responseContentType", mockRequest.getResponseContentType()).param("statusCode", String.valueOf(mockRequest.getStatusCode())).param("expectedTextResponse", mockRequest.getExpectedTextResponse()).param("description", mockRequest.getDescription())).andExpect(status().isBadRequest()).andExpect(response -> assertNotNull(response.getResolvedException())).andExpect(response -> assertTrue(response.getResolvedException().getMessage().contains("Description should be at least 1-250 characters"))).andReturn();
}
Also used : MockMultipartFile(org.springframework.mock.web.MockMultipartFile) Messages(com.arbindo.mimock.common.constants.Messages) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) MockManagementService(com.arbindo.mimock.manage.mimocks.service.MockManagementService) GenericResponseWrapper(com.arbindo.mimock.common.wrapper.GenericResponseWrapper) UserDetailsService(org.springframework.security.core.userdetails.UserDetailsService) Autowired(org.springframework.beans.factory.annotation.Autowired) DatabaseStartupValidator(org.springframework.jdbc.support.DatabaseStartupValidator) ArrayList(java.util.ArrayList) MockMvc(org.springframework.test.web.servlet.MockMvc) DataSourceAutoConfiguration(org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration) DefaultHttpInterceptor(com.arbindo.mimock.interceptor.DefaultHttpInterceptor) EmptySource(org.junit.jupiter.params.provider.EmptySource) MvcResult(org.springframework.test.web.servlet.MvcResult) DataSource(javax.sql.DataSource) SecurityAutoConfiguration(org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration) Pageable(org.springframework.data.domain.Pageable) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) MockBean(org.springframework.boot.test.mock.mockito.MockBean) MocksGenerator(com.arbindo.mimock.helpers.entities.MocksGenerator) JpaRepositoriesAutoConfiguration(org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration) UrlConfig(com.arbindo.mimock.common.constants.UrlConfig) JwtRequestFilter(com.arbindo.mimock.security.JwtRequestFilter) EnableAutoConfiguration(org.springframework.boot.autoconfigure.EnableAutoConfiguration) Status(com.arbindo.mimock.manage.mimocks.enums.Status) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) UUID(java.util.UUID) MockMvcResultMatchers(org.springframework.test.web.servlet.result.MockMvcResultMatchers) Page(org.springframework.data.domain.Page) MockMvcRequestBuilders(org.springframework.test.web.servlet.request.MockMvcRequestBuilders) MockMultipartFile(org.springframework.mock.web.MockMultipartFile) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) Test(org.junit.jupiter.api.Test) HttpStatus(org.springframework.http.HttpStatus) Mockito(org.mockito.Mockito) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) List(java.util.List) AutoConfigureMockMvc(org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest) MockMultipartHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder) Assertions(org.junit.jupiter.api.Assertions) UserDetailsServiceAutoConfiguration(org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration) NullSource(org.junit.jupiter.params.provider.NullSource) Mock(com.arbindo.mimock.entities.Mock) PageImpl(org.springframework.data.domain.PageImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ProcessedMockRequest(com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest) MockRequest(com.arbindo.mimock.manage.mimocks.models.request.MockRequest) JsonMapper.convertObjectToJsonString(com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString) RandomDataGenerator.generateRandomAlphabeticString(com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)

Aggregations

MockRequest (com.arbindo.mimock.manage.mimocks.models.request.MockRequest)11 ProcessedMockRequest (com.arbindo.mimock.manage.mimocks.models.request.ProcessedMockRequest)11 Test (org.junit.jupiter.api.Test)10 Mock (com.arbindo.mimock.entities.Mock)9 JsonMapper.convertObjectToJsonString (com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString)9 RandomDataGenerator.generateRandomAlphabeticString (com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)9 WebMvcTest (org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)9 MockMultipartFile (org.springframework.mock.web.MockMultipartFile)9 MvcResult (org.springframework.test.web.servlet.MvcResult)9 MockMultipartHttpServletRequestBuilder (org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder)7 Messages (com.arbindo.mimock.common.constants.Messages)5 UrlConfig (com.arbindo.mimock.common.constants.UrlConfig)5 GenericResponseWrapper (com.arbindo.mimock.common.wrapper.GenericResponseWrapper)5 MocksGenerator (com.arbindo.mimock.helpers.entities.MocksGenerator)5 DefaultHttpInterceptor (com.arbindo.mimock.interceptor.DefaultHttpInterceptor)5 Status (com.arbindo.mimock.manage.mimocks.enums.Status)5 MockManagementService (com.arbindo.mimock.manage.mimocks.service.MockManagementService)5 JwtRequestFilter (com.arbindo.mimock.security.JwtRequestFilter)5