@Test public void putAsyncNonResource() throws Exception { Sku sku = new Sku(); ServiceResponse<Sku> response = client.getLROsOperations().putAsyncNonResource(sku); Assert.assertEquals(200, response.getResponse().code()); Assert.assertEquals("100", response.getBody().getId()); }
@Test public void deleteProvisioning202Deletingcanceled200() throws Exception { ServiceResponse<Product> response = client.getLROsOperations().deleteProvisioning202Deletingcanceled200(); Assert.assertEquals(200, response.getResponse().code()); Assert.assertEquals("Canceled", response.getBody().getProvisioningState()); }
@Test public void putSubResource() throws Exception { SubProduct subProduct = new SubProduct(); ServiceResponse<SubProduct> response = client.getLROsOperations().putSubResource(subProduct); Assert.assertEquals(200, response.getResponse().code()); Assert.assertEquals("Succeeded", response.getBody().getProvisioningState()); }
@Test public void postAsyncRetrySucceeded() throws Exception { Product product = new Product(); product.setLocation("West US"); ServiceResponse<Product> response = client.getLROsOperations().postAsyncRetrySucceeded(product); Assert.assertEquals(200, response.getResponse().code()); }
@Test public void paramGet() throws Exception { client.restClient().headers().removeHeader("x-ms-client-request-id"); ServiceResponse<Void> response = client.xMsClientRequestIds().paramGet("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0"); Assert.assertEquals(200, response.getResponse().code()); }
@Test public void put200Succeeded() throws Exception { Product product = new Product(); product.setLocation("West US"); ServiceResponse<Product> response = client.getLROsOperations().put200Succeeded(product); Assert.assertEquals(200, response.getResponse().code()); Assert.assertEquals("Succeeded", response.getBody().getProvisioningState()); }
@Test public void put202Retry200() throws Exception { Product product = new Product(); product.setLocation("West US"); ServiceResponse<Product> response = client.getLROsOperations().put202Retry200(product); Assert.assertEquals(200, response.getResponse().code()); Assert.assertEquals("100", response.getBody().getId()); }
/** * Test implicitly optional query parameter * * @param queryParameter the String value * @throws ServiceException the exception wrapped in ServiceException if failed. */ public void putOptionalQuery(String queryParameter) throws ServiceException { try { Call<ResponseBody> call = service.putOptionalQuery(queryParameter); ServiceResponse<Void> response = putOptionalQueryDelegate(call.execute(), null); response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
/** * Test implicitly optional query parameter * * @return the Error object if successful. * @throws ServiceException the exception wrapped in ServiceException if failed. */ public Error getOptionalGlobalQuery() throws ServiceException { try { Call<ResponseBody> call = service.getOptionalGlobalQuery(this.client.getOptionalGlobalQuery()); ServiceResponse<Error> response = getOptionalGlobalQueryDelegate(call.execute(), null); return response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
/** * Test implicitly required path parameter * * @param pathParameter the String value * @return the Error object if successful. * @throws ServiceException the exception wrapped in ServiceException if failed. */ public Error getRequiredPath(String pathParameter) throws ServiceException { if (pathParameter == null) { throw new ServiceException( new IllegalArgumentException("Parameter pathParameter is required and cannot be null.")); } try { Call<ResponseBody> call = service.getRequiredPath(pathParameter); ServiceResponse<Error> response = getRequiredPathDelegate(call.execute(), null); return response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
/** * GET method with api-version modeled in global settings. * * @throws ServiceException the exception wrapped in ServiceException if failed. */ public void getPathGlobalValid() throws ServiceException { if (this.client.getApiVersion() == null) { throw new ServiceException( new IllegalArgumentException( "Parameter this.client.getApiVersion() is required and cannot be null.")); } try { Call<ResponseBody> call = service.getPathGlobalValid(this.client.getApiVersion(), this.client.getAcceptLanguage()); ServiceResponse<Void> response = getPathGlobalValidDelegate(call.execute(), null); response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
/** * Test implicitly required query parameter * * @return the Error object if successful. * @throws ServiceException the exception wrapped in ServiceException if failed. */ public Error getRequiredGlobalQuery() throws ServiceException { if (this.client.getRequiredGlobalQuery() == null) { throw new ServiceException( new IllegalArgumentException( "Parameter this.client.getRequiredGlobalQuery() is required and cannot be null.")); } try { Call<ResponseBody> call = service.getRequiredGlobalQuery(this.client.getRequiredGlobalQuery()); ServiceResponse<Error> response = getRequiredGlobalQueryDelegate(call.execute(), null); return response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
@Test public void getMethodQueryNull() throws Exception { ServiceResponse<Void> response = client.getMethodQueryNull(null); Assert.assertEquals(OK_STATUS_CODE, response.getResponse().code()); }
@Ignore("Not supported by OkHttp: https://github.com/square/okhttp/issues/2623") public void getSwaggerQueryValid() throws Exception { ServiceResponse<Void> response = client.getSwaggerQueryValid(); Assert.assertEquals(OK_STATUS_CODE, response.getResponse().code()); }
@Test public void getSwaggerPathValid() throws Exception { ServiceResponse<Void> response = client.getSwaggerPathValid(); Assert.assertEquals(OK_STATUS_CODE, response.getResponse().code()); }
@Test public void postSwaggerLocalValid() throws Exception { ServiceResponse<Void> response = client.getSubscriptionInMethod().postSwaggerLocalValid("1234-5678-9012-3456"); Assert.assertEquals(200, response.getResponse().code()); }
@Test public void delete202NoRetry204() throws Exception { ServiceResponse<Product> response = client.getLROsOperations().delete202NoRetry204(); Assert.assertEquals(204, response.getResponse().code()); }
@Test public void deleteNoHeaderInRetry() throws Exception { ServiceResponse<Void> response = client.getLROsOperations().deleteNoHeaderInRetry(); Assert.assertEquals(204, response.getResponse().code()); }
@Test public void post200WithPayload() throws Exception { ServiceResponse<Sku> response = client.getLROsOperations().post200WithPayload(); Assert.assertEquals(200, response.getResponse().code()); Assert.assertEquals("1", response.getBody().getId()); }
@Test public void deleteAsyncNoRetrySucceeded() throws Exception { ServiceResponse<Void> response = client.getLROsOperations().deleteAsyncNoRetrySucceeded(); Assert.assertEquals(200, response.getResponse().code()); }