### Question:
MetastoreLocatorExtensionPoint implements ExtensionPointInterface { @Override public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException { AbstractMeta meta; if ( object instanceof Trans ) { meta = ( (Trans) object ).getTransMeta(); } else if ( object instanceof JobExecutionExtension ) { meta = ( (JobExecutionExtension) object ).job.getJobMeta(); } else { meta = (AbstractMeta) object; } if ( meta.getMetastoreLocatorOsgi() == null ) { meta.setMetastoreLocatorOsgi( metastoreLocatorOsgi ); } } MetastoreLocatorExtensionPoint( MetastoreLocatorOsgi metastoreLocatorOsgi ); @Override void callExtensionPoint( LogChannelInterface log, Object object );  }### Answer:
@Test public void testCallExtensionPointWithTransMeta() throws Exception { MetastoreLocatorOsgi mockMetastoreLocator = mock( MetastoreLocatorOsgi.class ); LogChannelInterface logChannelInterface = mock( LogChannelInterface.class ); TransMeta mockTransMeta = mock( TransMeta.class ); MetastoreLocatorExtensionPoint metastoreLocatorExtensionPoint = new MetastoreLocatorExtensionPoint( mockMetastoreLocator ); metastoreLocatorExtensionPoint.callExtensionPoint( logChannelInterface, mockTransMeta ); verify( mockTransMeta ).setMetastoreLocatorOsgi( eq( mockMetastoreLocator ) ); }
@Test public void testCallExtensionPointWithTrans() throws Exception { MetastoreLocatorOsgi mockMetastoreLocator = mock( MetastoreLocatorOsgi.class ); LogChannelInterface logChannelInterface = mock( LogChannelInterface.class ); TransMeta mockTransMeta = mock( TransMeta.class ); Trans mockTrans = mock( Trans.class ); when( mockTrans.getTransMeta() ).thenReturn( mockTransMeta ); MetastoreLocatorExtensionPoint metastoreLocatorExtensionPoint = new MetastoreLocatorExtensionPoint( mockMetastoreLocator ); metastoreLocatorExtensionPoint.callExtensionPoint( logChannelInterface, mockTrans ); verify( mockTransMeta ).setMetastoreLocatorOsgi( eq( mockMetastoreLocator ) ); }