@Test public void testUpdateAppEntitlementNullResult() throws RemoteApiException { Map<String, String> headerParams = new HashMap<>(); headerParams.put("sessionToken", MOCK_SESSION); AppEntitlement entitlement = mockEntitlement(); AppEntitlement result = apiClient.updateAppEntitlement(MOCK_SESSION, entitlement); assertNull(result); }
public AppEntitlement updateAppEntitlement(String sessionToken, AppEntitlement entitlement) throws RemoteApiException { checkAuthToken(sessionToken); if (entitlement == null) { String reason = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL, ENTILTEMENT); String solution = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL_SOLUTION, ENTILTEMENT); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/admin/app/entitlement/list"; List<AppEntitlement> input = new ArrayList<>(); input.add(entitlement); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); AppEntitlementList result = apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), input, AppEntitlementList.class); if ((result != null) && (!result.isEmpty())) { return result.get(0); } return null; }
AppEntitlementApiClient extends BasePodApiClient { public AppEntitlement updateAppEntitlement(String sessionToken, AppEntitlement entitlement) throws RemoteApiException { checkAuthToken(sessionToken); if (entitlement == null) { String reason = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL, ENTILTEMENT); String solution = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL_SOLUTION, ENTILTEMENT); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/admin/app/entitlement/list"; List<AppEntitlement> input = new ArrayList<>(); input.add(entitlement); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); AppEntitlementList result = apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), input, AppEntitlementList.class); if ((result != null) && (!result.isEmpty())) { return result.get(0); } return null; } }
AppEntitlementApiClient extends BasePodApiClient { public AppEntitlement updateAppEntitlement(String sessionToken, AppEntitlement entitlement) throws RemoteApiException { checkAuthToken(sessionToken); if (entitlement == null) { String reason = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL, ENTILTEMENT); String solution = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL_SOLUTION, ENTILTEMENT); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/admin/app/entitlement/list"; List<AppEntitlement> input = new ArrayList<>(); input.add(entitlement); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); AppEntitlementList result = apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), input, AppEntitlementList.class); if ((result != null) && (!result.isEmpty())) { return result.get(0); } return null; } AppEntitlementApiClient(HttpApiClient apiClient, LogMessageSource logMessage); }
AppEntitlementApiClient extends BasePodApiClient { public AppEntitlement updateAppEntitlement(String sessionToken, AppEntitlement entitlement) throws RemoteApiException { checkAuthToken(sessionToken); if (entitlement == null) { String reason = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL, ENTILTEMENT); String solution = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL_SOLUTION, ENTILTEMENT); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/admin/app/entitlement/list"; List<AppEntitlement> input = new ArrayList<>(); input.add(entitlement); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); AppEntitlementList result = apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), input, AppEntitlementList.class); if ((result != null) && (!result.isEmpty())) { return result.get(0); } return null; } AppEntitlementApiClient(HttpApiClient apiClient, LogMessageSource logMessage); AppEntitlement updateAppEntitlement(String sessionToken, AppEntitlement entitlement); }
AppEntitlementApiClient extends BasePodApiClient { public AppEntitlement updateAppEntitlement(String sessionToken, AppEntitlement entitlement) throws RemoteApiException { checkAuthToken(sessionToken); if (entitlement == null) { String reason = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL, ENTILTEMENT); String solution = logMessage.getMessage(BODY_PAYLOAD_ELEMENT_NULL_SOLUTION, ENTILTEMENT); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/admin/app/entitlement/list"; List<AppEntitlement> input = new ArrayList<>(); input.add(entitlement); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); AppEntitlementList result = apiClient.doPost(path, headerParams, Collections.<String, String>emptyMap(), input, AppEntitlementList.class); if ((result != null) && (!result.isEmpty())) { return result.get(0); } return null; } AppEntitlementApiClient(HttpApiClient apiClient, LogMessageSource logMessage); AppEntitlement updateAppEntitlement(String sessionToken, AppEntitlement entitlement);  }