@Test(expected = IllegalArgumentException.class) public void getMessageThrows() throws Exception { EmailServiceImpl.getMessage(invalidGetMessageInputs); }
@NotNull public static Map<String, String> getMessage(@NotNull final GetMessageInputs getMessageInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); final Office365CommonInputs commonInputs = getMessageInputs.getCommonInputs(); httpClientInputs.setUrl(getMessageUrl(commonInputs.getUserPrincipalName(), commonInputs.getUserId(), getMessageInputs.getMessageId(), getMessageInputs.getFolderId())); setCommonHttpInputs(httpClientInputs, commonInputs); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(GET); httpClientInputs.setKeystore(DEFAULT_JAVA_KEYSTORE); httpClientInputs.setKeystorePassword(CHANGEIT); httpClientInputs.setResponseCharacterSet(commonInputs.getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(commonInputs.getAuthToken())); if (!isEmpty(getMessageInputs.getSelectQuery()) || !isEmpty(getMessageInputs.getoDataQuery())) { httpClientInputs.setQueryParams(getQueryParams(getMessageInputs.getSelectQuery(), getMessageInputs.getoDataQuery())); } return new HttpClientService().execute(httpClientInputs); }
EmailServiceImpl { @NotNull public static Map<String, String> getMessage(@NotNull final GetMessageInputs getMessageInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); final Office365CommonInputs commonInputs = getMessageInputs.getCommonInputs(); httpClientInputs.setUrl(getMessageUrl(commonInputs.getUserPrincipalName(), commonInputs.getUserId(), getMessageInputs.getMessageId(), getMessageInputs.getFolderId())); setCommonHttpInputs(httpClientInputs, commonInputs); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(GET); httpClientInputs.setKeystore(DEFAULT_JAVA_KEYSTORE); httpClientInputs.setKeystorePassword(CHANGEIT); httpClientInputs.setResponseCharacterSet(commonInputs.getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(commonInputs.getAuthToken())); if (!isEmpty(getMessageInputs.getSelectQuery()) || !isEmpty(getMessageInputs.getoDataQuery())) { httpClientInputs.setQueryParams(getQueryParams(getMessageInputs.getSelectQuery(), getMessageInputs.getoDataQuery())); } return new HttpClientService().execute(httpClientInputs); } }
EmailServiceImpl { @NotNull public static Map<String, String> getMessage(@NotNull final GetMessageInputs getMessageInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); final Office365CommonInputs commonInputs = getMessageInputs.getCommonInputs(); httpClientInputs.setUrl(getMessageUrl(commonInputs.getUserPrincipalName(), commonInputs.getUserId(), getMessageInputs.getMessageId(), getMessageInputs.getFolderId())); setCommonHttpInputs(httpClientInputs, commonInputs); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(GET); httpClientInputs.setKeystore(DEFAULT_JAVA_KEYSTORE); httpClientInputs.setKeystorePassword(CHANGEIT); httpClientInputs.setResponseCharacterSet(commonInputs.getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(commonInputs.getAuthToken())); if (!isEmpty(getMessageInputs.getSelectQuery()) || !isEmpty(getMessageInputs.getoDataQuery())) { httpClientInputs.setQueryParams(getQueryParams(getMessageInputs.getSelectQuery(), getMessageInputs.getoDataQuery())); } return new HttpClientService().execute(httpClientInputs); }  }
EmailServiceImpl { @NotNull public static Map<String, String> getMessage(@NotNull final GetMessageInputs getMessageInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); final Office365CommonInputs commonInputs = getMessageInputs.getCommonInputs(); httpClientInputs.setUrl(getMessageUrl(commonInputs.getUserPrincipalName(), commonInputs.getUserId(), getMessageInputs.getMessageId(), getMessageInputs.getFolderId())); setCommonHttpInputs(httpClientInputs, commonInputs); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(GET); httpClientInputs.setKeystore(DEFAULT_JAVA_KEYSTORE); httpClientInputs.setKeystorePassword(CHANGEIT); httpClientInputs.setResponseCharacterSet(commonInputs.getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(commonInputs.getAuthToken())); if (!isEmpty(getMessageInputs.getSelectQuery()) || !isEmpty(getMessageInputs.getoDataQuery())) { httpClientInputs.setQueryParams(getQueryParams(getMessageInputs.getSelectQuery(), getMessageInputs.getoDataQuery())); } return new HttpClientService().execute(httpClientInputs); }  @NotNull static Map<String, String> getMessage(@NotNull final GetMessageInputs getMessageInputs); @NotNull static Map<String, String> sendMessage(@NotNull final SendMessageInputs postMessageInputs); @NotNull static Map<String, String> listMessages(@NotNull final ListMessagesInputs listMessagesInputs); @NotNull static Map<String, String> createMessage(@NotNull final CreateMessageInputs createMessageInputs); @NotNull static Map<String, String> deleteMessage(@NotNull final DeleteMessageInputs deleteMessageInputs); @NotNull static Map<String, String> moveMessage(@NotNull final MoveMessageInputs moveMessageInputs); @NotNull static Map<String, String> addAttachment(@NotNull final AddAttachmentInputs addAttachmentInputs); @NotNull static Map<String, String> getAttachments(@NotNull final GetAttachmentsInputs getAttachmentsInputs); static String addAditionalOutputs(Map<String, String> results, Map<String, String> result, String returnMessage, String filePath); static void addOutput(Map<String, String> results, JsonObject responseJson, String key, String keyToAdd); @NotNull static Map<String, String> listAttachment(@NotNull final ListAttachmentsInputs getListAttachmentInputs); static String retrieveAttachmentIdList(String returnMessage); }
EmailServiceImpl { @NotNull public static Map<String, String> getMessage(@NotNull final GetMessageInputs getMessageInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); final Office365CommonInputs commonInputs = getMessageInputs.getCommonInputs(); httpClientInputs.setUrl(getMessageUrl(commonInputs.getUserPrincipalName(), commonInputs.getUserId(), getMessageInputs.getMessageId(), getMessageInputs.getFolderId())); setCommonHttpInputs(httpClientInputs, commonInputs); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(GET); httpClientInputs.setKeystore(DEFAULT_JAVA_KEYSTORE); httpClientInputs.setKeystorePassword(CHANGEIT); httpClientInputs.setResponseCharacterSet(commonInputs.getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(commonInputs.getAuthToken())); if (!isEmpty(getMessageInputs.getSelectQuery()) || !isEmpty(getMessageInputs.getoDataQuery())) { httpClientInputs.setQueryParams(getQueryParams(getMessageInputs.getSelectQuery(), getMessageInputs.getoDataQuery())); } return new HttpClientService().execute(httpClientInputs); }  @NotNull static Map<String, String> getMessage(@NotNull final GetMessageInputs getMessageInputs); @NotNull static Map<String, String> sendMessage(@NotNull final SendMessageInputs postMessageInputs); @NotNull static Map<String, String> listMessages(@NotNull final ListMessagesInputs listMessagesInputs); @NotNull static Map<String, String> createMessage(@NotNull final CreateMessageInputs createMessageInputs); @NotNull static Map<String, String> deleteMessage(@NotNull final DeleteMessageInputs deleteMessageInputs); @NotNull static Map<String, String> moveMessage(@NotNull final MoveMessageInputs moveMessageInputs); @NotNull static Map<String, String> addAttachment(@NotNull final AddAttachmentInputs addAttachmentInputs); @NotNull static Map<String, String> getAttachments(@NotNull final GetAttachmentsInputs getAttachmentsInputs); static String addAditionalOutputs(Map<String, String> results, Map<String, String> result, String returnMessage, String filePath); static void addOutput(Map<String, String> results, JsonObject responseJson, String key, String keyToAdd); @NotNull static Map<String, String> listAttachment(@NotNull final ListAttachmentsInputs getListAttachmentInputs); static String retrieveAttachmentIdList(String returnMessage);  }