### Question:
Message { public ApiMessageView mapToView() { return new ApiMessageView(Collections.singletonList(mapToApiMessage())); } private  Message(String requestedKey,
                    MessageTemplate messageTemplate,
                    Object[] messageParameters); static Message of(String requestedKey,
                             MessageTemplate messageTemplate,
                             Object[] messageParameters); String getConvertedText(); String mapToReadableText(); ApiMessageView mapToView(); ApiMessage mapToApiMessage(); String mapToLogMessage(); MessageTemplate getMessageTemplate(); static final String INVALID_KEY_MESSAGE; static final String INVALID_MESSAGE_TEXT_FORMAT; }### Answer:
@Test public void testMapToView() { ApiMessageView actualApiMessageView = message.mapToView(); assertEquals("ApiMessageView doesn't contain single message", 1, actualApiMessageView.getMessages().size()); String expectedReadableText = "No response received within the allowed time: 3000"; ApiMessageView expectedApiMessageView = new ApiMessageView(Collections.singletonList( new ApiMessage("org.zowe.apiml.common.serviceTimeout", MessageType.ERROR, "ZWEAM700E", expectedReadableText) )); assertEquals("ApiMessageView is different", expectedApiMessageView, actualApiMessageView); }