@Test
	public void testProfileCardsCrud() throws BeanstreamApiException {
		String profileId = null;
		try {
			Address billing = getTestBillingAddress();
			Card card = getTestCard();
			// test create profile
			ProfileResponse createdProfile = beanstream.profiles()
					.createProfile(card, billing);
			profileId = createdProfile.getId();
			Assert.assertNotNull(
					"Test failed because it should create the profile and return a valid id",
					profileId);

			// test getCards
			List<Card> profileCards = beanstream.profiles().getCards(profileId);
			Assert.assertFalse("this profile should have one credit card",
					profileCards.isEmpty());
			Card card1 = profileCards.get(0);

			// test getCard
			Card freshCard = beanstream.profiles().getCard(profileId,
					card1.getId());
			Assert.assertNotNull(
					"Test failed because it should return a valid card",
					freshCard);
			// add a new card
			Card newCard = getTestCard();
			newCard.setCvd("123");
			newCard.setName("John Doe");
			newCard.setNumber("4030000010001234");
			newCard.setExpiryMonth("01");
			newCard.setExpiryYear("19");
			
			
			ProfileResponse newCardResp = beanstream.profiles().addCard(profileId, newCard);
			
			
			// update the card expires date
			freshCard.setExpiryMonth("01");
			freshCard.setExpiryYear("19");
                        freshCard.setName("Bob Two");
			
			
			ProfileResponse profileResponse = beanstream.profiles().updateCard(profileId, freshCard);
			//2659 Douglas Street	V8T 4M3
	
//			Address newCardAddr = getAddress("Pedro Garcia", "VICTORIA", "BC", "CA", "2659 Douglas Street", "V8T4M3", "TEST@BEANSTREAM.COM", "12501234567");
			freshCard = beanstream.profiles().getCard(profileId,
					freshCard.getId());
			Assert.assertEquals("the Expiry Month was updated but the change is not reflected", "01",freshCard.getExpiryMonth());
			Assert.assertEquals("the Expiry Year was updated but the change is not reflected", "19",freshCard.getExpiryYear());
		} catch (BeanstreamApiException ex) {
			Assert.fail(ex.getMessage());
		} catch (Exception ex) {
			Assert.fail("unexpected exception occur, test can not continue : "
					+ ex.getMessage());
		} finally {
			if (profileId != null) {
				ProfileResponse response = beanstream.profiles()
						.deleteProfileById(profileId);
			}
		}
	}