コード例 #1
0
  @Test
  public void shouldMapToIVRWebResponse() {
    SubscriptionDetailsResponse detailsResponse =
        new SubscriptionDetailsResponse(
            UUID.randomUUID().toString(),
            SubscriptionPack.BARI_KILKARI,
            SubscriptionStatus.ACTIVE,
            "WEEK13",
            null,
            DateTime.now());
    ArrayList<SubscriptionDetailsResponse> responseList = new ArrayList<>();
    responseList.add(detailsResponse);

    SubscriptionBaseWebResponse webResponse =
        SubscriptionDetailsMapper.mapFrom(responseList, Channel.IVR);

    SubscriptionIVRWebResponse ivrWebResponse = (SubscriptionIVRWebResponse) webResponse;
    assertEquals(1, ivrWebResponse.getSubscriptionDetails().size());
    SubscriptionDetails subscriptionDetails = ivrWebResponse.getSubscriptionDetails().get(0);
    assertEquals(detailsResponse.getSubscriptionId(), subscriptionDetails.getSubscriptionId());
    assertEquals(detailsResponse.getPack().name(), subscriptionDetails.getPack());
    assertEquals(detailsResponse.getStatus().getDisplayString(), subscriptionDetails.getStatus());
    assertEquals(detailsResponse.getCampaignId(), subscriptionDetails.getLastCampaignId());
  }
コード例 #2
0
 private void assertDetails(
     SubscriptionDetailsResponse detailsResponse, AllSubscriptionDetails subscriptionDetails) {
   assertEquals(detailsResponse.getSubscriptionId(), subscriptionDetails.getSubscriptionId());
   assertEquals(detailsResponse.getPack().name(), subscriptionDetails.getPack());
   assertEquals(detailsResponse.getStatus().getDisplayString(), subscriptionDetails.getStatus());
   assertEquals(detailsResponse.getCampaignId(), subscriptionDetails.getLastCampaignId());
   assertEquals(detailsResponse.getBeneficiaryName(), subscriptionDetails.getBeneficiaryName());
   assertEquals(detailsResponse.getBeneficiaryAge(), subscriptionDetails.getBeneficiaryAge());
   assertEquals(detailsResponse.getStartWeekNumber(), subscriptionDetails.getWeekNumber());
   assertEquals(detailsResponse.getDateOfBirth(), subscriptionDetails.getDateOfBirth());
   assertEquals(
       detailsResponse.getExpectedDateOfDelivery(),
       subscriptionDetails.getExpectedDateOfDelivery());
   assertEquals(
       detailsResponse.getLastWeeklyMessageScheduledDate(),
       subscriptionDetails.getLastWeeklyMessageScheduledDate());
   assertEquals(
       detailsResponse.getLastUpdatedTimeForSubscription(),
       subscriptionDetails.getLastUpdatedTimeForSubscription());
   assertEquals(
       detailsResponse.getLastUpdatedTimeForBeneficiary(),
       subscriptionDetails.getLastUpdatedTimeForBeneficiary());
 }