@Test
public void updateFactMappingProperty() {

    final int INDEX = 0;
    final String ALIAS_1 = "ALIAS_1";
    final String ALIAS_2 = "ALIAS_2";
    FactMapping factMappingReference = mock(FactMapping.class);
    FactMapping factMappingToCheck = mock(FactMapping.class);
    FactIdentifier factIdentifier1 = mock(FactIdentifier.class);
    // Should execute
    when(factMappingReference.getFactIdentifier()).thenReturn(FactIdentifier.EMPTY);
    when(factMappingToCheck.getFactIdentifier()).thenReturn(FactIdentifier.EMPTY);
    when(factMappingReference.getFactAlias()).thenReturn(ALIAS_1);
    when(factMappingToCheck.getFactAlias()).thenReturn(ALIAS_1);
    when(factMappingReference.getFullExpression()).thenReturn(ALIAS_1);
    when(factMappingToCheck.getFullExpression()).thenReturn(ALIAS_1);
    when(simulationDescriptorMock.getFactMappingByIndex(INDEX)).thenReturn(factMappingToCheck);
    abstractScesimGridModelSpy.updateFactMapping(simulationDescriptorMock, factMappingReference, INDEX, MULTIPART_VALUE, ScenarioHeaderMetaData.MetadataType.PROPERTY);
    verify(propertyHeaderMetaDataMock, times(1)).setTitle(eq(MULTIPART_VALUE));
    verify(factMappingToCheck, times(1)).setExpressionAlias(eq(MULTIPART_VALUE));
    reset(propertyHeaderMetaDataMock);
    reset(factMappingToCheck);
    // Should not execute
    when(factMappingToCheck.getFactAlias()).thenReturn(ALIAS_2);
    abstractScesimGridModelSpy.updateFactMapping(simulationDescriptorMock, factMappingReference, INDEX, MULTIPART_VALUE, ScenarioHeaderMetaData.MetadataType.PROPERTY);
    verify(propertyHeaderMetaDataMock, never()).setTitle(eq(MULTIPART_VALUE));
    verify(factMappingToCheck, never()).setExpressionAlias(eq(MULTIPART_VALUE));
    reset(propertyHeaderMetaDataMock);
    reset(factMappingToCheck);
    // Should not execute
    when(factMappingReference.getFactIdentifier()).thenReturn(factIdentifier1);
    when(factMappingToCheck.getFactAlias()).thenReturn(ALIAS_1);
    when(factMappingToCheck.getFullExpression()).thenReturn(ALIAS_2);
    abstractScesimGridModelSpy.updateFactMapping(simulationDescriptorMock, factMappingReference, INDEX, MULTIPART_VALUE, ScenarioHeaderMetaData.MetadataType.PROPERTY);
    verify(propertyHeaderMetaDataMock, never()).setTitle(eq(MULTIPART_VALUE));
    verify(factMappingToCheck, never()).setExpressionAlias(eq(MULTIPART_VALUE));
}