@Test public void testCreateIM() throws RemoteApiException { Map<String, String> headerParams = new HashMap<>(); headerParams.put("sessionToken", MOCK_SESSION); Stream stream = mockStream(); List<Long> uidList = new ArrayList<>(); uidList.add(MOCK_USER_ID); doReturn(stream).when(httpClient) .doPost("/v1/im/create", headerParams, Collections.<String, String>emptyMap(), uidList, Stream.class); Stream result = apiClient.createIM(MOCK_SESSION, uidList); assertEquals(stream, result); }
public Stream createIM(String sessionToken, List<Long> uidList) throws RemoteApiException { checkAuthToken(sessionToken); if (uidList == null) { String reason = logMessage.getMessage(INSTANCE_EMPTY, CREATE_IM); String solution = logMessage.getMessage(INSTANCE_EMPTY_SOLUTION, CREATE_IM); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/im/create"; Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), uidList, Stream.class); }
StreamApiClient extends BasePodApiClient { public Stream createIM(String sessionToken, List<Long> uidList) throws RemoteApiException { checkAuthToken(sessionToken); if (uidList == null) { String reason = logMessage.getMessage(INSTANCE_EMPTY, CREATE_IM); String solution = logMessage.getMessage(INSTANCE_EMPTY_SOLUTION, CREATE_IM); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/im/create"; Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), uidList, Stream.class); } }
StreamApiClient extends BasePodApiClient { public Stream createIM(String sessionToken, List<Long> uidList) throws RemoteApiException { checkAuthToken(sessionToken); if (uidList == null) { String reason = logMessage.getMessage(INSTANCE_EMPTY, CREATE_IM); String solution = logMessage.getMessage(INSTANCE_EMPTY_SOLUTION, CREATE_IM); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/im/create"; Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), uidList, Stream.class); } StreamApiClient(HttpApiClient apiClient, LogMessageSource logMessage); }
StreamApiClient extends BasePodApiClient { public Stream createIM(String sessionToken, List<Long> uidList) throws RemoteApiException { checkAuthToken(sessionToken); if (uidList == null) { String reason = logMessage.getMessage(INSTANCE_EMPTY, CREATE_IM); String solution = logMessage.getMessage(INSTANCE_EMPTY_SOLUTION, CREATE_IM); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/im/create"; Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), uidList, Stream.class); } StreamApiClient(HttpApiClient apiClient, LogMessageSource logMessage); Stream createIM(String sessionToken, List<Long> uidList); }
StreamApiClient extends BasePodApiClient { public Stream createIM(String sessionToken, List<Long> uidList) throws RemoteApiException { checkAuthToken(sessionToken); if (uidList == null) { String reason = logMessage.getMessage(INSTANCE_EMPTY, CREATE_IM); String solution = logMessage.getMessage(INSTANCE_EMPTY_SOLUTION, CREATE_IM); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/im/create"; Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), uidList, Stream.class); } StreamApiClient(HttpApiClient apiClient, LogMessageSource logMessage); Stream createIM(String sessionToken, List<Long> uidList);  }