Class MultiCodeCouponWebServicesTest

All Implemented Interfaces:
JaloSessionHolder

@IntegrationTest public class MultiCodeCouponWebServicesTest extends AbstractCouponWebServicesTest
  • Constructor Details

    • MultiCodeCouponWebServicesTest

      public MultiCodeCouponWebServicesTest()
  • Method Details

    • setUp

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

      public void testGetCouponsWithoutAuthorization()
    • testGetCouponUsingClientCredentials

      public void testGetCouponUsingClientCredentials()

      the test is for occ api of "/couponservices/v2/multicodecoupon/get/{couponId}" which etrieves a multi-code coupon for a given couponId

      Parameters:
      couponId -
    • shouldReturnMultiCodeCoupons

      public void shouldReturnMultiCodeCoupons()

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

    • shouldReturnMultiCodeCouponsSortedByNameWithDescOrder

      public void shouldReturnMultiCodeCouponsSortedByNameWithDescOrder()
    • shouldReturnMultiCodeCouponsPaged

      public void shouldReturnMultiCodeCouponsPaged()
    • testPostMultiCodeCouponWsDTO

      public void testPostMultiCodeCouponWsDTO()

      the test is for occ api of "/couponservices/v2/multicodecoupon/create" This endpoint creates a new multi-code coupon given in POST body

      Parameters:
      couponWsDTO -
    • testPostEmptyMultiCodeCouponWsDTO

      public void testPostEmptyMultiCodeCouponWsDTO()
      The test should detect the fail with 2 errors:
      errors" : [ {
      "message" : "This field is required.",
      "reason" : "missing",
      "subject" : "couponId",
      "subjectType" : "parameter",
      "type" : "ValidationError"
      }, {
      "message" : "This field is required.",
      "reason" : "missing",
      "subject" : "codeGenerationConfiguration",
      "subjectType" : "parameter",
      "type" : "ValidationError"
      }
    • putMultiCodeCouponWsDTO

      protected javax.ws.rs.core.Response putMultiCodeCouponWsDTO(String couponId, String couponName, String startDateVal, String endDateVal, String genConfigName)
    • testPutMultiCodeCouponWsDTO

      public void testPutMultiCodeCouponWsDTO()

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

      Parameters:
      MultiCodeCouponWsDTO -
    • testPutMultiCodeActiveCouponWsDTO

      public void testPutMultiCodeActiveCouponWsDTO()
    • testPutEmptyMultiCodeCouponWsDTO

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

      public void testPutInvalidMultiCodeCouponWsDTO()
    • testPutInvalidMultiCodeCouponWsDTO2

      public void testPutInvalidMultiCodeCouponWsDTO2()
    • testPutInvalidConfigMultiCodeCouponWsDTO

      public void testPutInvalidConfigMultiCodeCouponWsDTO()
    • testPutUsedConfigMultiCodeCouponWsDTO

      public void testPutUsedConfigMultiCodeCouponWsDTO()
    • testPutMultiCodeCouponWithDatesWsDTO

      public void testPutMultiCodeCouponWithDatesWsDTO()
    • testPutMultiCodeCouponWithInconsistentDatesWsDTO

      public void testPutMultiCodeCouponWithInconsistentDatesWsDTO()
    • testPutCouponStatusWithoutAuthorization

      public void testPutCouponStatusWithoutAuthorization()
    • testPutCouponStatusWsDTO1

      public void testPutCouponStatusWsDTO1()

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

      Parameters:
      couponId - ,active=false
    • testPutCouponStatusWsDTO2

      public void testPutCouponStatusWsDTO2()

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

      Parameters:
      couponId -
      active - =true
    • testPutEmptyStatusCouponStatusWsDTO

      public void testPutEmptyStatusCouponStatusWsDTO()
    • testValidateMultiCodeCouponWithoutAuthorization

      public void testValidateMultiCodeCouponWithoutAuthorization()
    • testValidateMultiCodeCouponUsingClientCredentials

      public void testValidateMultiCodeCouponUsingClientCredentials()

      the test is for occ api of "/couponservices/v2/multicodecoupon/validate/{couponCode}" which validates a multi-code coupon with given coupon code

      Parameters:
      couponId -
    • testValidateMultiCodeCouponWhenCouponIsNotActive

      public void testValidateMultiCodeCouponWhenCouponIsNotActive()

      the test is for occ api of "/couponservices/v2/multicodecoupon/validate/{couponCode}" which validates a multi-code coupon with given coupon code which is not active

      Parameters:
      couponId -
    • testValidateMultiCodeCouponWhenCouponIdIsUsed

      public void testValidateMultiCodeCouponWhenCouponIdIsUsed()