예제 #1
0
 @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());
 }
예제 #2
0
 @Test
 public void deleteProvisioning202Deletingcanceled200() throws Exception {
   ServiceResponse<Product> response =
       client.getLROsOperations().deleteProvisioning202Deletingcanceled200();
   Assert.assertEquals(200, response.getResponse().code());
   Assert.assertEquals("Canceled", response.getBody().getProvisioningState());
 }
예제 #3
0
 @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());
 }
예제 #4
0
 @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());
 }
예제 #5
0
 @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());
 }
예제 #6
0
 @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());
 }
예제 #7
0
 @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());
 }
예제 #8
0
 /**
  * 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);
   }
 }
예제 #9
0
 /**
  * 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);
   }
 }
예제 #10
0
 /**
  * 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);
   }
 }
예제 #11
0
 /**
  * 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);
   }
 }
예제 #12
0
 /**
  * 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);
   }
 }
예제 #13
0
 @Test
 public void getMethodQueryNull() throws Exception {
   ServiceResponse<Void> response = client.getMethodQueryNull(null);
   Assert.assertEquals(OK_STATUS_CODE, response.getResponse().code());
 }
예제 #14
0
 @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());
 }
예제 #15
0
 @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());
 }
예제 #17
0
 @Test
 public void delete202NoRetry204() throws Exception {
   ServiceResponse<Product> response = client.getLROsOperations().delete202NoRetry204();
   Assert.assertEquals(204, response.getResponse().code());
 }
예제 #18
0
 @Test
 public void deleteNoHeaderInRetry() throws Exception {
   ServiceResponse<Void> response = client.getLROsOperations().deleteNoHeaderInRetry();
   Assert.assertEquals(204, response.getResponse().code());
 }
예제 #19
0
 @Test
 public void post200WithPayload() throws Exception {
   ServiceResponse<Sku> response = client.getLROsOperations().post200WithPayload();
   Assert.assertEquals(200, response.getResponse().code());
   Assert.assertEquals("1", response.getBody().getId());
 }
예제 #20
0
 @Test
 public void deleteAsyncNoRetrySucceeded() throws Exception {
   ServiceResponse<Void> response = client.getLROsOperations().deleteAsyncNoRetrySucceeded();
   Assert.assertEquals(200, response.getResponse().code());
 }