@Test
public void postPotentialDuplicateInvalidUidTeiB()
{

    TrackedEntityInstance teiA = new TrackedEntityInstance();
    teiA.setUid( "ABCDEFGHIJ1" );
    Mockito.when( trackedEntityInstanceService.getTrackedEntityInstance( Mockito.eq( "ABCDEFGHIJ1" ) ) )
        .thenReturn( teiA );
    Mockito.when( trackerAccessManager.canRead( Mockito.any(), Mockito.eq( teiA ) ) ).thenReturn(
        Lists.newArrayList() );
    try
    {
        controller.postPotentialDuplicate( new PotentialDuplicate( "ABCDEFGHIJ1", "invalid" ) );
    }
    catch ( WebMessageException e )
    {
        WebMessage wm = e.getWebMessage();
        assertEquals( "Conflict", wm.getHttpStatus() );
        assertEquals( 409, wm.getHttpStatusCode().intValue() );
        assertEquals( Status.ERROR, wm.getStatus() );
        assertEquals( "'invalid' is not valid value for property 'teiB'", wm.getMessage() );
    }
}