src/test/java/systemtests/AddressBookSystemTest.java
protected void assertSelectedCardChanged(Index expectedSelectedCardIndex) {
        String selectedCardLocation = getParcelListPanel().getHandleToSelectedCard().getAddress();
        URL expectedUrl;
        try {
            int postalCodeLength = 7;
            expectedUrl = new URL(GOOGLE_MAP_URL_PREFIX
                    + getMapQueryStringFromPostalString(selectedCardLocation.substring(
                            selectedCardLocation.length() - postalCodeLength)));
        } catch (MalformedURLException mue) {
            throw new AssertionError("URL expected to be valid.");
        }

        int correctUrlLength = GOOGLE_MAP_URL_PREFIX.length() + QUERY_POSTAL_CODE_LENGTH;
        String actualParcelUrl = getBrowserPanel().getLoadedUrl().toString().substring(0, correctUrlLength);
        assertEquals(expectedUrl.toString(), actualParcelUrl);
        assertEquals(expectedSelectedCardIndex.getZeroBased(), getParcelListPanel().getSelectedCardIndex());
    }
/**
     * Asserts that the browser's url is changed to display the details of the parcel in the parcel list panel at
     * {@code expectedSelectedCardIndex}, and only the card at {@code expectedSelectedCardIndex} is selected.
     * @see BrowserPanelHandle#isUrlChanged()
     * @see ParcelListPanelHandle#isSelectedParcelCardChanged()
     */
Asserts that the browser's url is changed to display the details of the parcel in the parcel list panel at
expectedSelectedCardIndex, and only the card at  expectedSelectedCardIndex is selected.
Asserts that the browser ' s url is changed to display the details of the parcel in the parcel list panel at expectedSelectedCardIndex and only the card at expectedSelectedCardIndex is selected .
protected void assertSelectedCardChanged(Index expectedSelectedCardIndex) {
        String selectedCardLocation = getParcelListPanel().getHandleToSelectedCard().getAddress();
        URL expectedUrl;
        try {
            int postalCodeLength = 7;
            expectedUrl = new URL(GOOGLE_MAP_URL_PREFIX
                    + getMapQueryStringFromPostalString(selectedCardLocation.substring(
                            selectedCardLocation.length() - postalCodeLength)));
        } catch (MalformedURLException mue) {
            throw new AssertionError("URL expected to be valid.");
        }
        int correctUrlLength = GOOGLE_MAP_URL_PREFIX.length() + QUERY_POSTAL_CODE_LENGTH;
        String actualParcelUrl = getBrowserPanel().getLoadedUrl().toString().substring(0, correctUrlLength);
        assertEquals(expectedUrl.toString(), actualParcelUrl);
        assertEquals(expectedSelectedCardIndex.getZeroBased(), getParcelListPanel().getSelectedCardIndex());
    }
protected void assertSelectedCardChanged ( Index expectedSelectedCardIndex ) { String selectedCardLocation = getParcelListPanel ( ) . getHandleToSelectedCard ( ) . getAddress ( ) ; URL expectedUrl ; try { int postalCodeLength = 7 ; expectedUrl = new URL ( GOOGLE_MAP_URL_PREFIX + getMapQueryStringFromPostalString ( selectedCardLocation . substring ( selectedCardLocation . length ( ) - postalCodeLength ) ) ) ; } catch ( MalformedURLException mue ) { throw new AssertionError ( "URL expected to be valid." ) ; } int correctUrlLength = GOOGLE_MAP_URL_PREFIX . length ( ) + QUERY_POSTAL_CODE_LENGTH ; String actualParcelUrl = getBrowserPanel ( ) . getLoadedUrl ( ) . toString ( ) . substring ( 0 , correctUrlLength ) ; assertEquals ( expectedUrl . toString ( ) , actualParcelUrl ) ; assertEquals ( expectedSelectedCardIndex . getZeroBased ( ) , getParcelListPanel ( ) . getSelectedCardIndex ( ) ) ; }
Asserts that the browser's url is changed to display the details of the parcel in the parcel list panel at
 {@code expectedSelectedCardIndex}, and only the card at {@code expectedSelectedCardIndex} is selected.
Asserts that the browser ' s url is changed to display the details of the parcel in the parcel list panel at { @code expectedSelectedCardIndex } and only the card at { @code expectedSelectedCardIndex } is selected .