Class SingleCodeCouponWebServicesTest

All Implemented Interfaces:
JaloSessionHolder

@IntegrationTest public class SingleCodeCouponWebServicesTest extends AbstractCouponWebServicesTest
  • Constructor Details

    • SingleCodeCouponWebServicesTest

      public SingleCodeCouponWebServicesTest()
  • Method Details

    • setUp

      public void setUp() throws Exception
      Throws:
      Exception
    • testGetSingleCodeCouponsWithoutAuthorization

      public void testGetSingleCodeCouponsWithoutAuthorization()
    • shouldReturnSingleCodeCouponsSortedByNameWithDescOrder

      public void shouldReturnSingleCodeCouponsSortedByNameWithDescOrder()

      the test is for occ api of "/couponservices/v2/singlecodecoupon/list" which retrieves all of the single-code coupons that are registered in the system

    • shouldReturnSingleCodeCouponsPaged

      public void shouldReturnSingleCodeCouponsPaged()
    • shouldReturnSingleCodeCoupons

      public void shouldReturnSingleCodeCoupons()
    • testGetSingleCodeCouponUsingClientCredentials

      public void testGetSingleCodeCouponUsingClientCredentials()

      the test is for occ api of "/couponservices/v2/singlecodecoupon/get/{couponId}" which retrieves a single-code coupon for a given couponId

      Parameters:
      couponId -
    • testPostSingleCodeCouponWsDTO

      public void testPostSingleCodeCouponWsDTO()

      the test is for occ api of "/couponservices/v2/singlecodecoupon/create" which creates a new single-code coupon object with the parameters provided in POST body

      Parameters:
      SingleCodeCouponWsDTO -
    • testPostEmptySingleCodeCouponWsDTO

      public void testPostEmptySingleCodeCouponWsDTO()
      The test should detect the fail with 1 error:
      errors" : [ {
      "message" : "This field is required.",
      "reason" : "missing",
      "subject" : "couponId",
      "subjectType" : "parameter",
      "type" : "ValidationError"
      } ]
    • testPostSingleCodeCouponWithDatesWsDTO

      public void testPostSingleCodeCouponWithDatesWsDTO()
    • testPostSingleCodeCouponWithInconsistentDatesWsDTO

      public void testPostSingleCodeCouponWithInconsistentDatesWsDTO()
    • putSingleCodeCouponWsDTO

      protected javax.ws.rs.core.Response putSingleCodeCouponWsDTO(String couponId, String couponName, String startDateVal, String endDateVal, Integer maxRedemptionsPerCustomer, Integer maxTotalRedemptions)
    • testPutSingleCodeCouponWsDTO

      public void testPutSingleCodeCouponWsDTO()

      the test is for occ api of "/couponservices​/v2​/singlecodecoupon​/update" which updates single-code coupon data as provided in PUT body

      Parameters:
      SingleCodeCouponWsDTO -
    • testPutSingleCodeActiveCouponWsDTO

      public void testPutSingleCodeActiveCouponWsDTO()
    • testPutEmptySingleCodeCouponWsDTO

      public void testPutEmptySingleCodeCouponWsDTO()
      The test should detect the fail with 1 error:
      errors" : [ {
      "message" : "This field is required.",
      "reason" : "missing",
      "subject" : "couponId",
      "subjectType" : "parameter",
      "type" : "ValidationError"
      } ]
    • testPutInvalidSingleCodeCouponWsDTO

      public void testPutInvalidSingleCodeCouponWsDTO()
    • testPutInvalidSingleCodeCouponWsDTO2

      public void testPutInvalidSingleCodeCouponWsDTO2()
    • testPutSingleCodeCouponWithInvalidDatesWsDTO

      public void testPutSingleCodeCouponWithInvalidDatesWsDTO()
    • testPutSingleCodeCouponWithDatesWsDTO

      public void testPutSingleCodeCouponWithDatesWsDTO()
    • testPutSingleCodeCouponWithInconsistentDatesWsDTO

      public void testPutSingleCodeCouponWithInconsistentDatesWsDTO()
    • testPutCouponStatusWithoutAuthorization

      public void testPutCouponStatusWithoutAuthorization()
    • testPutCouponStatusWsDTO1

      public void testPutCouponStatusWsDTO1()

      the test is for occ api of "/couponservices/v2/singlecodecoupon/update/status" which updates status of a single-code coupon as provided in POST body.

      Parameters:
      SingleCodeCouponWsDTO -
    • testPutCouponStatusWsDTO2

      public void testPutCouponStatusWsDTO2()
    • testPutEmptyStatusCouponStatusWsDTO

      public void testPutEmptyStatusCouponStatusWsDTO()
    • testValidateSingleCodeCouponWithoutAuthorization

      public void testValidateSingleCodeCouponWithoutAuthorization()
    • testValidateSingleCodeCouponUsingClientCredentials

      public void testValidateSingleCodeCouponUsingClientCredentials()

      the test is for occ api of "/couponservices​/v2​/singlecodecoupon​/validate​/{couponId}" which validates a single-code coupon with a given couponId

      Parameters:
      couponId -
    • testValidateSingleCodeCouponWhenCouponIsInvalid

      public void testValidateSingleCodeCouponWhenCouponIsInvalid()
    • testValidateSingleCodeCouponWithCustomerId

      public void testValidateSingleCodeCouponWithCustomerId()
    • testValidateSingleCodeCouponWithCustomerIdWhenCouponIsNotValid

      public void testValidateSingleCodeCouponWithCustomerIdWhenCouponIsNotValid()
    • testValidateSingleCodeCouponWhenCouponCodeIsNotFound

      public void testValidateSingleCodeCouponWhenCouponCodeIsNotFound()