@Test public void getType_not_required() { SidoContext context = mock(SidoContext.class); DefaultSidoSchema schema = new DefaultSidoSchema(context, UID); SidoType type = schema.getType("Person", false); assertNull(type); }
@Test public void addType() { SidoContext context = mock(SidoContext.class); DefaultSidoSchema schema = new DefaultSidoSchema(context, UID); SidoType type = mock(SidoType.class); when(type.getName()).thenReturn("Person"); schema.addType(type); assertSame(type, schema.getType("Person", true)); }
@Test(expected = SidoTypeNotFoundInSchemaException.class) public void getType_required() { SidoContext context = mock(SidoContext.class); DefaultSidoSchema schema = new DefaultSidoSchema(context, UID); schema.getType("Person", true); }