/*
 * Copyright (c) 2017, University of Oslo
 *
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 * Neither the name of the HISP project nor the names of its contributors may
 * be used to endorse or promote products derived from this software without
 * specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.hisp.dhis.android.core.relationship;

import com.fasterxml.jackson.databind.ObjectMapper;

import org.hisp.dhis.android.core.Inject;
import org.hisp.dhis.android.core.common.BaseIdentifiableObject;
import org.junit.Test;

import java.io.IOException;
import java.text.ParseException;

import static org.assertj.core.api.Java6Assertions.assertThat;

public class RelationshipTypeShould {

    @Test
    public void map_from_json_string_29() throws IOException, ParseException {
        ObjectMapper objectMapper = Inject.objectMapper();

        RelationshipType relationshipType =
                objectMapper.readValue("relationship/relationshipType29.json", RelationshipType.class);

        assertThat(relationshipType.uid()).isEqualTo("V2kkHafqs8G");
        assertThat(relationshipType.name()).isEqualTo("Mother-Child");
        assertThat(relationshipType.displayName()).isEqualTo("Mother-Child");
        assertThat(relationshipType.created()).isEqualTo(
                BaseIdentifiableObject.DATE_FORMAT.parse("2013-09-19T15:17:41.000"));
        assertThat(relationshipType.lastUpdated()).isEqualTo(
                BaseIdentifiableObject.DATE_FORMAT.parse("2014-04-14T13:53:20.166"));
        assertThat(relationshipType.aIsToB()).isEqualTo("Mother");
        assertThat(relationshipType.bIsToA()).isEqualTo("Child");
    }
}

@@ -1752,24 +1752,83 @@
 ableObject;%0A
+import org.hisp.dhis.android.core.common.BaseObjectShould;%0A
 import org.j
@@ -1838,16 +1838,16 @@
 t.Test;%0A
-
 %0Aimport 
@@ -2001,17 +2001,142 @@
 eShould 
-%7B
+extends BaseObjectShould %7B%0A%0A    public RelationshipTypeShould() %7B%0A        super(%22relationship/relationshipType29.json%22);%0A    %7D
 %0A%0A    @T
@@ -2365,46 +2365,18 @@
 lue(
-%22relationship/relationshipType29.json%22
+jsonStream
 , Re

fix RelationshipType test