@Test
public void testOneLeggedFactsAsPropsWithoutReadPermission() {

  UUID objectId = UUID.randomUUID();
  ObjectRecord objectRecord = new ObjectRecord().setId(objectId);
  FactTypeStruct factType1 = mockFactType("factType1");
  FactTypeStruct factType2 = mockFactType("factType2");
  FactRecord fact1 = new FactRecord().setTypeID(factType1.getId()).setValue("factValue1");
  FactRecord fact2 = new FactRecord().setTypeID(factType2.getId()).setValue("factValue2");
  when(securityContext.hasReadPermission(any(FactRecord.class))).thenReturn(false);
  when(objectFactDao.searchFacts(argThat(x -> Objects.equals(x.getObjectID(), set(objectId))))).thenReturn(
          ResultContainer.<FactRecord>builder().setValues(ListUtils.list(fact1, fact2).iterator()).build()
  );
  assertEquals(0, helper.getOneLeggedFactsAsProperties(objectRecord, TraverseParams.builder().build()).size());
  verify(securityContext).hasReadPermission(fact1);
  verify(securityContext).hasReadPermission(fact2);
}