### Question:
ThingAgent implements ThingService { @AgentCreated public IFuture<Void> created() { log.debug("Agent created"); thingServiceId = getThingServiceId(); log.debug("Agent has ThingService with id '{}'", thingServiceId); Map<String, ExposedThingProperty<Object>> properties = thing.getProperties(); if (!properties.isEmpty()) { if (true) { String href = buildAllPropertiesURI(thingServiceId).toString(); Form form = new Form.Builder() .setHref(href) .setContentType(ContentManager.DEFAULT) .setOp(Operation.READ_ALL_PROPERTIES, Operation.READ_MULTIPLE_PROPERTIES) .build(); thing.addForm(form); log.debug("Assign '{}' for reading all properties", href); } } properties.forEach((name, property) -> { String href = buildInteractionURI(thingServiceId, "properties", name).toString(); Form form = new Form.Builder() .setHref(href) .setContentType(ContentManager.DEFAULT) .setOp(Operation.READ_PROPERTY, Operation.WRITE_PROPERTY) .build(); property.addForm(form); log.debug("Assign '{}' to Property '{}'", href, name); }); Map<String, ExposedThingAction<Object, Object>> actions = thing.getActions(); actions.forEach((name, action) -> { String href = buildInteractionURI(thingServiceId, "actions", name).toString(); Form form = new Form.Builder() .setHref(href) .setContentType(ContentManager.DEFAULT) .setOp(Operation.INVOKE_ACTION) .build(); action.addForm(form); log.debug("Assign '{}' to Action '{}'", href, name); }); Map<String, ExposedThingEvent<Object>> events = thing.getEvents(); events.forEach((name, event) -> { String href = buildInteractionURI(thingServiceId, "events", name).toString(); Form form = new Form.Builder() .setHref(href) .setContentType(ContentManager.DEFAULT) .setOp(Operation.SUBSCRIBE_EVENT) .build(); event.addForm(form); log.debug("Assign '{}' to Event '{}'", href, name); }); return DONE; } ThingAgent();   ThingAgent(IInternalAccess agent, ExposedThing thing); @AgentCreated IFuture<Void> created(); @AgentKilled void killed(); @Override IFuture<String> get(); @Override IFuture<JadexContent> readProperties(); @Override IFuture<JadexContent> readProperty(String name); @Override IFuture<JadexContent> writeProperty(String name, JadexContent content); @Override String getThingServiceId();  }### Answer:
@Test public void createdShouldAddForms() { when(ia.getProvidedService(ThingService.class)).thenReturn(thingService); when(((IService) thingService).getServiceId()).thenReturn(mock(IServiceIdentifier.class)); when(thing.getId()).thenReturn("counter"); when(thing.getProperties()).thenReturn(Map.of("count", property)); when(property.isObservable()).thenReturn(true); when(thing.getActions()).thenReturn(Map.of("reset", action)); when(thing.getEvents()).thenReturn(Map.of("changed", event)); ThingAgent agent = new ThingAgent(ia, thing); agent.created(); verify(thing, timeout(1 * 1000L)).addForm(any()); verify(property, timeout(1 * 1000L).times(1)).addForm(any()); verify(action, timeout(1 * 1000L)).addForm(any()); verify(event, timeout(1 * 1000L)).addForm(any()); }