    void getGadgets() throws Exception
    {
        assertEquals(new ArrayList<>(), this.defaultGadgetSource.getGadgets(testSource, macroTransformationContext));

        BaseObject gadgetObject1 = mock(BaseObject.class);
        when(xWikiDocument.getXObjects(gadgetClassReference)).thenReturn(Collections.singletonList(gadgetObject1));
        when(gadgetObject1.getOwnerDocument()).thenReturn(ownerDocument);
        when(gadgetObject1.getStringValue("title")).thenReturn("Gadget 1");
        when(gadgetObject1.getLargeStringValue("content")).thenReturn("Some content");
        when(gadgetObject1.getStringValue("position")).thenReturn("0");
        when(gadgetObject1.getNumber()).thenReturn(42);

        List<Gadget> gadgets = this.defaultGadgetSource.getGadgets(testSource, macroTransformationContext);
        assertEquals(1, gadgets.size());
        Gadget gadget = gadgets.get(0);
        assertEquals("Gadget 1", gadget.getTitle().get(0).toString());
        assertEquals("Some content", gadget.getContent().get(0).toString());
        assertEquals("42", gadget.getId());
    }
The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.