use of com.arbindo.mimock.entities.ResponseContentType in project mimock by arbindo.
the class ResponseContentTypesRepositoryTest method shouldReturnNullForInvalidApplicationTypeWhenEmptyOrNull.
@ParameterizedTest
@EmptySource
@NullSource
void shouldReturnNullForInvalidApplicationTypeWhenEmptyOrNull(String applicationResponseType) {
// Act
ResponseContentType responseType = responseContentTypesRepository.findByContentType(applicationResponseType);
// Assert
assertNull(responseType);
}
use of com.arbindo.mimock.entities.ResponseContentType in project mimock by arbindo.
the class ResponseContentTypesRepositoryTest method shouldReturnResponseContentTypeForValidImageType.
@ParameterizedTest
@ValueSource(strings = { "image/gif", "image/jpeg", "image/png", "image/svg+xml" })
void shouldReturnResponseContentTypeForValidImageType(String imageResponseType) {
// Act
ResponseContentType responseType = responseContentTypesRepository.findByContentType(imageResponseType);
// Assert
assertNotNull(responseType);
assertEquals(imageResponseType, responseType.getContentType());
}
use of com.arbindo.mimock.entities.ResponseContentType in project mimock by arbindo.
the class ResponseContentTypesRepositoryTest method shouldReturnNullForInvalidAudioType.
@ParameterizedTest
@ValueSource(strings = { "audio/x-ms-wma", "audio/vnd.rn-realaudio", "audio/x-wav" })
void shouldReturnNullForInvalidAudioType(String audioResponseType) {
// Act
ResponseContentType responseType = responseContentTypesRepository.findByContentType(audioResponseType);
// Assert
assertNull(responseType);
}
use of com.arbindo.mimock.entities.ResponseContentType in project mimock by arbindo.
the class ResponseContentTypesRepositoryTest method shouldReturnNullForInvalidVideoType.
@ParameterizedTest
@ValueSource(strings = { "video/quicktime", "video/x-ms-wmv", "video/x-flv" })
void shouldReturnNullForInvalidVideoType(String videoResponseType) {
// Act
ResponseContentType responseType = responseContentTypesRepository.findByContentType(videoResponseType);
// Assert
assertNull(responseType);
}
use of com.arbindo.mimock.entities.ResponseContentType in project mimock by arbindo.
the class ResponseContentTypesRepositoryTest method shouldReturnNullForCaseSensitiveResponseTypeStrings.
@ParameterizedTest
@ValueSource(strings = { "application/json OR 1=1", "text/css; DROP TABLE mocks;" })
void shouldReturnNullForCaseSensitiveResponseTypeStrings(String applicationResponseType) {
// Act
ResponseContentType responseType = responseContentTypesRepository.findByContentType(applicationResponseType);
// Assert
assertNull(responseType);
}
Aggregations