use of com.arbindo.mimock.entities.BinaryResponse in project mimock by arbindo.
the class ResponseFactoryExecutorTest method shouldReturnImplementationForBinaryResponse.
@Test
void shouldReturnImplementationForBinaryResponse() {
byte[] bytes = "Test string".getBytes(StandardCharsets.UTF_8);
BinaryResponse binaryResponse = BinaryResponse.builder().responseFile(bytes).build();
Mock binaryResponseMock = Mock.builder().textualResponse(null).binaryResponse(binaryResponse).build();
ResponseFactory responseFactory = responseFactoryExecutor.responseFactory(binaryResponseMock);
assertEquals(BinaryResponseImpl.class, responseFactory.getClass());
assertEquals(binaryResponse.getResponseFile(), responseFactory.responseBody());
}
use of com.arbindo.mimock.entities.BinaryResponse in project mimock by arbindo.
the class DomainModelMapperTest method shouldReturnModelWithBinaryResponseFactory.
@Test
void shouldReturnModelWithBinaryResponseFactory() {
ResponseContentType responseContentType = ResponseContentType.builder().contentType("application/json").build();
byte[] bytes = "Test string".getBytes(StandardCharsets.UTF_8);
BinaryResponse binaryResponse = BinaryResponse.builder().responseFile(bytes).build();
Mock testMock = Mock.builder().responseContentType(responseContentType).statusCode(200).textualResponse(null).binaryResponse(binaryResponse).build();
DomainModelForMock mappedModel = domainModelMapper.mappedModel(testMock);
assertEquals(bytes, mappedModel.getResponseBody());
assertEquals(200, mappedModel.getStatusCode());
assertEquals(TypeOfResponse.BINARY_RESPONSE, mappedModel.getTypeOfResponse());
assertEquals("application/json", mappedModel.getResponseContentType());
}
use of com.arbindo.mimock.entities.BinaryResponse in project mimock by neel1996.
the class ResponseFactoryExecutorTest method shouldReturnImplementationForBinaryResponse.
@Test
void shouldReturnImplementationForBinaryResponse() {
byte[] bytes = "Test string".getBytes(StandardCharsets.UTF_8);
BinaryResponse binaryResponse = BinaryResponse.builder().responseFile(bytes).build();
Mock binaryResponseMock = Mock.builder().textualResponse(null).binaryResponse(binaryResponse).build();
ResponseFactory responseFactory = responseFactoryExecutor.responseFactory(binaryResponseMock);
assertEquals(BinaryResponseImpl.class, responseFactory.getClass());
assertEquals(binaryResponse.getResponseFile(), responseFactory.responseBody());
}
use of com.arbindo.mimock.entities.BinaryResponse in project mimock by neel1996.
the class DomainModelMapperTest method shouldReturnModelWithBinaryResponseFactory.
@Test
void shouldReturnModelWithBinaryResponseFactory() {
ResponseContentType responseContentType = ResponseContentType.builder().contentType("application/json").build();
byte[] bytes = "Test string".getBytes(StandardCharsets.UTF_8);
BinaryResponse binaryResponse = BinaryResponse.builder().responseFile(bytes).build();
Mock testMock = Mock.builder().responseContentType(responseContentType).statusCode(200).textualResponse(null).binaryResponse(binaryResponse).build();
DomainModelForMock mappedModel = domainModelMapper.mappedModel(testMock);
assertEquals(bytes, mappedModel.getResponseBody());
assertEquals(200, mappedModel.getStatusCode());
assertEquals(TypeOfResponse.BINARY_RESPONSE, mappedModel.getTypeOfResponse());
assertEquals("application/json", mappedModel.getResponseContentType());
}
Aggregations