### Question:
ThreatIntelligenceServiceImpl implements Service, ThreatIntelligenceService { @Override public Object getObject(RequestHeader rh, GetObjectByIdRequest request) throws AccessDeniedException, AuthenticationFailedException, InvalidArgumentException { return delegateProvider.get(ObjectGetDelegate.class).handle(request); } @Inject  ThreatIntelligenceServiceImpl(AccessController accessController,
                                       IdentityResolver identityResolver,
                                       FactManager factManager,
                                       ObjectFactDao objectFactDao,
                                       DelegateProvider delegateProvider); @Override SecurityContext createSecurityContext(Credentials credentials); @Override ObjectType getObjectType(RequestHeader rh, GetObjectTypeByIdRequest request); @Override ResultSet<ObjectType> searchObjectTypes(RequestHeader rh, SearchObjectTypeRequest request); @Override ObjectType createObjectType(RequestHeader rh, CreateObjectTypeRequest request); @Override ObjectType updateObjectType(RequestHeader rh, UpdateObjectTypeRequest request); @Override FactType getFactType(RequestHeader rh, GetFactTypeByIdRequest request); @Override ResultSet<FactType> searchFactTypes(RequestHeader rh, SearchFactTypeRequest request); @Override FactType createFactType(RequestHeader rh, CreateFactTypeRequest request); @Override FactType updateFactType(RequestHeader rh, UpdateFactTypeRequest request); @Override Object getObject(RequestHeader rh, GetObjectByIdRequest request); @Override Object getObject(RequestHeader rh, GetObjectByTypeValueRequest request); @Override ResultSet<Fact> searchObjectFacts(RequestHeader rh, SearchObjectFactsRequest request); @Override ResultSet<Object> searchObjects(RequestHeader rh, SearchObjectRequest request); @Override Fact getFact(RequestHeader rh, GetFactByIdRequest request); @Override ResultSet<Fact> searchFacts(RequestHeader rh, SearchFactRequest request); @Override Fact createFact(RequestHeader rh, CreateFactRequest request); @Override ResultSet<Fact> searchMetaFacts(RequestHeader rh, SearchMetaFactsRequest request); @Override Fact createMetaFact(RequestHeader rh, CreateMetaFactRequest request); @Override Fact retractFact(RequestHeader rh, RetractFactRequest request); @Override ResultSet<FactComment> getFactComments(RequestHeader rh, GetFactCommentsRequest request); @Override FactComment createFactComment(RequestHeader rh, CreateFactCommentRequest request); @Override ResultSet<AclEntry> getFactAcl(RequestHeader rh, GetFactAclRequest request); @Override AclEntry grantFactAccess(RequestHeader rh, GrantFactAccessRequest request); @Deprecated @Override ResultSet<?> traverseGraph(RequestHeader rh, TraverseByObjectIdRequest request); @Deprecated @Override ResultSet<?> traverseGraph(RequestHeader rh, TraverseByObjectTypeValueRequest request); @Deprecated @Override ResultSet<?> traverseGraph(RequestHeader rh, TraverseByObjectSearchRequest request); @Override ResultSet<?> traverse(RequestHeader rh, TraverseGraphByObjectsRequest request); @Override ResultSet<?> traverse(RequestHeader rh, TraverseGraphByObjectSearchRequest request); @Override Origin getOrigin(RequestHeader rh, GetOriginByIdRequest request); @Override ResultSet<Origin> searchOrigins(RequestHeader rh, SearchOriginRequest request); @Override Origin createOrigin(RequestHeader rh, CreateOriginRequest request); @Override Origin updateOrigin(RequestHeader rh, UpdateOriginRequest request); @Override Origin deleteOrigin(RequestHeader rh, DeleteOriginRequest request); static final UUID GLOBAL_NAMESPACE; }### Answer:
@Test public void testGetObjectByIdCallsDelegate() throws Exception { ObjectGetDelegate delegate = mock(ObjectGetDelegate.class); when(delegateProvider.get(ObjectGetDelegate.class)).thenReturn(delegate); GetObjectByIdRequest request = new GetObjectByIdRequest(); service.getObject(RequestHeader.builder().build(), request); verify(delegate).handle(request); }
@Test public void testGetObjectByTypeValueCallsDelegate() throws Exception { ObjectGetDelegate delegate = mock(ObjectGetDelegate.class); when(delegateProvider.get(ObjectGetDelegate.class)).thenReturn(delegate); GetObjectByTypeValueRequest request = new GetObjectByTypeValueRequest(); service.getObject(RequestHeader.builder().build(), request); verify(delegate).handle(request); }