Improved test

This commit is contained in:
Luca Frosini 2024-11-07 13:34:43 +01:00
parent 2ff9841de2
commit 40fa20a871
1 changed files with 10 additions and 7 deletions

View File

@ -478,14 +478,17 @@ public class ContextManagementTest extends ContextTest {
@Test @Test
public void testGetAll() throws Exception { public void testGetAll() throws Exception {
List<Context> contexts = getAll(); // List<Context> contexts = getAll();
contexts = ServerContextCache.getInstance().getContexts(); // List<Context> contexts = ServerContextCache.getInstance().getContexts();
List<Context> contexts = ServerContextCache.getInstance().getFullInfoContexts();
for(Context context : contexts) { for(Context context : contexts) {
logger.info(ElementMapper.marshal(context)); logger.info("{}", context.getName());
List<IsParentOf> children = context.getChildren(); List<IsParentOf> childrenIsParentOf = context.getChildren();
for(IsParentOf child : children) { for(IsParentOf childIsParentOf : childrenIsParentOf) {
Assert.assertTrue(child.getSource() == context); Assert.assertTrue(childIsParentOf.getSource() == context);
Context childContext = child.getTarget(); Context childContext = childIsParentOf.getTarget();
logger.info(" --- Child {}", childContext.getName());
Assert.assertTrue(childContext.getParent() == childIsParentOf);
Assert.assertTrue(childContext.getParent().getSource() == context); Assert.assertTrue(childContext.getParent().getSource() == context);
} }
roleUserAssertions(context.getID(), null, false); roleUserAssertions(context.getID(), null, false);