You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RepositoryContentConsumersTest.java 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. package org.apache.archiva.repository.scanner;
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. import junit.framework.TestCase;
  21. import org.apache.archiva.configuration.ArchivaConfiguration;
  22. import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
  23. import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
  24. import org.apache.archiva.repository.base.managed.BasicManagedRepository;
  25. import org.apache.archiva.repository.base.remote.BasicRemoteRepository;
  26. import org.apache.archiva.repository.ManagedRepository;
  27. import org.apache.archiva.repository.RemoteRepository;
  28. import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
  29. import org.apache.commons.lang3.SystemUtils;
  30. import org.junit.Test;
  31. import org.junit.runner.RunWith;
  32. import org.mockito.Mockito;
  33. import org.springframework.beans.BeansException;
  34. import org.springframework.beans.factory.BeanFactory;
  35. import org.springframework.beans.factory.NoSuchBeanDefinitionException;
  36. import org.springframework.beans.factory.ObjectProvider;
  37. import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
  38. import org.springframework.context.ApplicationContext;
  39. import org.springframework.context.ApplicationEvent;
  40. import org.springframework.context.MessageSourceResolvable;
  41. import org.springframework.context.NoSuchMessageException;
  42. import org.springframework.core.ResolvableType;
  43. import org.springframework.core.env.Environment;
  44. import org.springframework.core.io.Resource;
  45. import org.springframework.test.context.ContextConfiguration;
  46. import javax.inject.Inject;
  47. import java.io.IOException;
  48. import java.lang.annotation.Annotation;
  49. import java.net.URI;
  50. import java.net.URISyntaxException;
  51. import java.nio.file.Path;
  52. import java.nio.file.Paths;
  53. import java.util.Arrays;
  54. import java.util.Collections;
  55. import java.util.Date;
  56. import java.util.HashMap;
  57. import java.util.List;
  58. import java.util.Locale;
  59. import java.util.Map;
  60. import java.util.function.Function;
  61. import static org.mockito.Mockito.*;
  62. /**
  63. * RepositoryContentConsumersTest
  64. */
  65. @RunWith( ArchivaSpringJUnit4ClassRunner.class )
  66. @ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
  67. public class RepositoryContentConsumersTest
  68. extends TestCase
  69. {
  70. @Inject
  71. ApplicationContext applicationContext;
  72. protected ManagedRepository createRepository( String id, String name, Path location ) throws IOException {
  73. BasicManagedRepository repo = BasicManagedRepository.newFilesystemInstance(id, name, location.getParent().resolve(id));
  74. repo.setLocation( location.toAbsolutePath().toUri() );
  75. return repo;
  76. }
  77. protected RemoteRepository createRemoteRepository( String id, String name, String url ) throws URISyntaxException, IOException {
  78. BasicRemoteRepository repo = BasicRemoteRepository.newFilesystemInstance(id, name, Paths.get("remotes"));
  79. repo.setLocation( new URI( url ) );
  80. return repo;
  81. }
  82. private RepositoryContentConsumers lookupRepositoryConsumers()
  83. throws Exception
  84. {
  85. ArchivaConfiguration configuration =
  86. applicationContext.getBean( "archivaConfiguration#test-conf", ArchivaConfiguration.class );
  87. ArchivaAdministrationStub administrationStub = new ArchivaAdministrationStub( configuration );
  88. RepositoryContentConsumers consumerUtilStub = new RepositoryContentConsumersStub( administrationStub );
  89. RepositoryContentConsumers consumerUtil =
  90. applicationContext.getBean( "repositoryContentConsumers#test", RepositoryContentConsumers.class );
  91. ApplicationContext context = new MockApplicationContext( consumerUtil.getAvailableKnownConsumers(), //
  92. consumerUtil.getAvailableInvalidConsumers() );
  93. consumerUtilStub.setApplicationContext( context );
  94. consumerUtilStub.setSelectedInvalidConsumers( consumerUtil.getSelectedInvalidConsumers() );
  95. consumerUtilStub.setSelectedKnownConsumers( consumerUtil.getSelectedKnownConsumers() );
  96. consumerUtilStub.setArchivaAdministration( administrationStub );
  97. assertNotNull( "RepositoryContentConsumers should not be null.", consumerUtilStub );
  98. return consumerUtilStub;
  99. }
  100. @Test
  101. public void testGetSelectedKnownIds()
  102. throws Exception
  103. {
  104. RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
  105. String expectedKnownIds[] =
  106. new String[]{ "create-missing-checksums", "validate-checksum", "validate-signature", "index-content",
  107. "auto-remove", "auto-rename", "create-archiva-metadata", "duplicate-artifacts" };
  108. //update-db-artifact, create-missing-checksums, update-db-repository-metadata,
  109. //validate-checksum, validate-signature, index-content, auto-remove, auto-rename,
  110. //metadata-updater
  111. List<String> knownConsumers = consumerutil.getSelectedKnownConsumerIds();
  112. assertNotNull( "Known Consumer IDs should not be null", knownConsumers );
  113. assertEquals( "Known Consumer IDs.size " + knownConsumers, expectedKnownIds.length, knownConsumers.size() );
  114. for ( String expectedId : expectedKnownIds )
  115. {
  116. assertTrue( "Known id [" + expectedId + "] exists.", knownConsumers.contains( expectedId ) );
  117. }
  118. }
  119. @Test
  120. public void testGetSelectedInvalidIds()
  121. throws Exception
  122. {
  123. RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
  124. String expectedInvalidIds[] = new String[]{ "update-db-bad-content" };
  125. List<String> invalidConsumers = consumerutil.getSelectedInvalidConsumerIds();
  126. assertNotNull( "Invalid Consumer IDs should not be null", invalidConsumers );
  127. assertEquals( "Invalid Consumer IDs.size", expectedInvalidIds.length, invalidConsumers.size() );
  128. for ( String expectedId : expectedInvalidIds )
  129. {
  130. assertTrue( "Invalid id [" + expectedId + "] exists.", invalidConsumers.contains( expectedId ) );
  131. }
  132. }
  133. @Test
  134. public void testGetSelectedKnownConsumerMap()
  135. throws Exception
  136. {
  137. RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
  138. String expectedSelectedKnownIds[] =
  139. new String[]{ "create-missing-checksums", "validate-checksum", "index-content", "auto-remove",
  140. "auto-rename" };
  141. Map<String, KnownRepositoryContentConsumer> knownConsumerMap = consumerutil.getSelectedKnownConsumersMap();
  142. assertNotNull( "Known Consumer Map should not be null", knownConsumerMap );
  143. assertEquals( "Known Consumer Map.size but " + knownConsumerMap, expectedSelectedKnownIds.length,
  144. knownConsumerMap.size() );
  145. for ( String expectedId : expectedSelectedKnownIds )
  146. {
  147. KnownRepositoryContentConsumer consumer = knownConsumerMap.get( expectedId );
  148. assertNotNull( "Known[" + expectedId + "] should not be null.", consumer );
  149. assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId() );
  150. }
  151. }
  152. @Test
  153. public void testGetSelectedInvalidConsumerMap()
  154. throws Exception
  155. {
  156. RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
  157. String expectedSelectedInvalidIds[] = new String[]{ "update-db-bad-content" };
  158. Map<String, InvalidRepositoryContentConsumer> invalidConsumerMap =
  159. consumerutil.getSelectedInvalidConsumersMap();
  160. assertNotNull( "Invalid Consumer Map should not be null", invalidConsumerMap );
  161. assertEquals( "Invalid Consumer Map.size", expectedSelectedInvalidIds.length, invalidConsumerMap.size() );
  162. for ( String expectedId : expectedSelectedInvalidIds )
  163. {
  164. InvalidRepositoryContentConsumer consumer = invalidConsumerMap.get( expectedId );
  165. assertNotNull( "Known[" + expectedId + "] should not be null.", consumer );
  166. assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId() );
  167. }
  168. }
  169. @Test
  170. public void testGetAvailableKnownList()
  171. throws Exception
  172. {
  173. RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
  174. String expectedKnownIds[] =
  175. new String[]{ "update-db-artifact", "create-missing-checksums", "update-db-repository-metadata",
  176. "validate-checksum", "index-content", "auto-remove", "auto-rename", "available-but-unselected" };
  177. List<KnownRepositoryContentConsumer> knownConsumers = consumerutil.getAvailableKnownConsumers();
  178. assertNotNull( "known consumers should not be null.", knownConsumers );
  179. assertEquals( "known consumers", expectedKnownIds.length, knownConsumers.size() );
  180. List<String> expectedIds = Arrays.asList( expectedKnownIds );
  181. for ( KnownRepositoryContentConsumer consumer : knownConsumers )
  182. {
  183. assertTrue( "Consumer [" + consumer.getId() + "] returned by .getAvailableKnownConsumers() is unexpected.",
  184. expectedIds.contains( consumer.getId() ) );
  185. }
  186. }
  187. @Test
  188. public void testGetAvailableInvalidList()
  189. throws Exception
  190. {
  191. RepositoryContentConsumers consumerutil = lookupRepositoryConsumers();
  192. String expectedInvalidIds[] = new String[]{ "update-db-bad-content", "move-to-trash-then-notify" };
  193. List<InvalidRepositoryContentConsumer> invalidConsumers = consumerutil.getAvailableInvalidConsumers();
  194. assertNotNull( "invalid consumers should not be null.", invalidConsumers );
  195. assertEquals( "invalid consumers", expectedInvalidIds.length, invalidConsumers.size() );
  196. List<String> expectedIds = Arrays.asList( expectedInvalidIds );
  197. for ( InvalidRepositoryContentConsumer consumer : invalidConsumers )
  198. {
  199. assertTrue(
  200. "Consumer [" + consumer.getId() + "] returned by .getAvailableInvalidConsumers() is unexpected.",
  201. expectedIds.contains( consumer.getId() ) );
  202. }
  203. }
  204. @Test
  205. public void testExecution()
  206. throws Exception
  207. {
  208. RepositoryContentConsumers consumers = lookupRepositoryConsumers();
  209. KnownRepositoryContentConsumer selectedKnownConsumer =
  210. mock( KnownRepositoryContentConsumer.class );
  211. KnownRepositoryContentConsumer unselectedKnownConsumer =
  212. mock( KnownRepositoryContentConsumer.class );
  213. consumers.setApplicationContext(
  214. new MockApplicationContext( Arrays.asList( selectedKnownConsumer, unselectedKnownConsumer ), null ) );
  215. consumers.setSelectedKnownConsumers( Collections.singletonList( selectedKnownConsumer ) );
  216. InvalidRepositoryContentConsumer selectedInvalidConsumer =
  217. mock( InvalidRepositoryContentConsumer.class );
  218. InvalidRepositoryContentConsumer unselectedInvalidConsumer =
  219. mock( InvalidRepositoryContentConsumer.class );
  220. consumers.setApplicationContext(
  221. new MockApplicationContext( null, Arrays.asList( selectedInvalidConsumer, unselectedInvalidConsumer ) ) );
  222. consumers.setSelectedInvalidConsumers( Collections.singletonList( selectedInvalidConsumer ) );
  223. ManagedRepository repo = createRepository( "id", "name", Paths.get( "target/test-repo" ) );
  224. Path testFile = Paths.get( "target/test-repo/path/to/test-file.txt" );
  225. Date startTime = new Date( System.currentTimeMillis() );
  226. startTime.setTime( 12345678 );
  227. selectedKnownConsumer.beginScan( repo, startTime, false );
  228. when( selectedKnownConsumer.getIncludes() ).thenReturn( Collections.singletonList( "**/*.txt" ) );
  229. selectedKnownConsumer.processFile( _OS( "path/to/test-file.txt" ), false );
  230. selectedInvalidConsumer.beginScan( repo, startTime, false );
  231. consumers.executeConsumers( repo, testFile, true );
  232. Path notIncludedTestFile = Paths.get( "target/test-repo/path/to/test-file.xml" );
  233. selectedKnownConsumer.beginScan( repo, startTime, false );
  234. when( selectedKnownConsumer.getExcludes() ).thenReturn( Collections.<String>emptyList() );
  235. when( selectedKnownConsumer.getIncludes() ).thenReturn( Collections.singletonList( "**/*.txt" ) );
  236. selectedInvalidConsumer.beginScan( repo, startTime, false );
  237. selectedInvalidConsumer.processFile( _OS( "path/to/test-file.xml" ), false );
  238. when( selectedInvalidConsumer.getId() ).thenReturn( "invalid" );
  239. consumers.executeConsumers( repo, notIncludedTestFile, true );
  240. Path excludedTestFile = Paths.get( "target/test-repo/path/to/test-file.txt" );
  241. selectedKnownConsumer.beginScan( repo, startTime, false );
  242. when( selectedKnownConsumer.getExcludes() ).thenReturn( Collections.singletonList( "**/test-file.txt" ) );
  243. selectedInvalidConsumer.beginScan( repo, startTime, false );
  244. selectedInvalidConsumer.processFile( _OS( "path/to/test-file.txt" ), false );
  245. when( selectedInvalidConsumer.getId() ).thenReturn( "invalid" );
  246. consumers.executeConsumers( repo, excludedTestFile, true );
  247. }
  248. /**
  249. * Create an OS specific version of the filepath.
  250. * Provide path in unix "/" format.
  251. */
  252. private String _OS( String path )
  253. {
  254. if ( SystemUtils.IS_OS_WINDOWS )
  255. {
  256. return path.replace( '/', '\\' );
  257. }
  258. return path;
  259. }
  260. private static <T> Map<String, T> convertToMap( List<T> objects)
  261. {
  262. HashMap<String,T> map = new HashMap<>();
  263. for ( T o : objects )
  264. {
  265. map.put( o.toString(), o );
  266. }
  267. return map;
  268. }
  269. private static <T> Function<List<T>,Map<String,T>> getConversionFunction(Class<T> type) {
  270. return ts -> convertToMap( ts );
  271. }
  272. public class MockApplicationContext
  273. implements ApplicationContext
  274. {
  275. private List<KnownRepositoryContentConsumer> knownRepositoryContentConsumer;
  276. private List<InvalidRepositoryContentConsumer> invalidRepositoryContentConsumers;
  277. public MockApplicationContext( List<KnownRepositoryContentConsumer> knownRepositoryContentConsumer,
  278. List<InvalidRepositoryContentConsumer> invalidRepositoryContentConsumers )
  279. {
  280. this.knownRepositoryContentConsumer = knownRepositoryContentConsumer;
  281. this.invalidRepositoryContentConsumers = invalidRepositoryContentConsumers;
  282. }
  283. @Override
  284. public String getApplicationName()
  285. {
  286. return "foo";
  287. }
  288. @Override
  289. public AutowireCapableBeanFactory getAutowireCapableBeanFactory()
  290. throws IllegalStateException
  291. {
  292. throw new UnsupportedOperationException( "Not supported yet." );
  293. }
  294. @Override
  295. public String getDisplayName()
  296. {
  297. throw new UnsupportedOperationException( "Not supported yet." );
  298. }
  299. @Override
  300. public String getId()
  301. {
  302. throw new UnsupportedOperationException( "Not supported yet." );
  303. }
  304. @Override
  305. public ApplicationContext getParent()
  306. {
  307. throw new UnsupportedOperationException( "Not supported yet." );
  308. }
  309. @Override
  310. public long getStartupDate()
  311. {
  312. throw new UnsupportedOperationException( "Not supported yet." );
  313. }
  314. @Override
  315. public boolean containsBeanDefinition( String beanName )
  316. {
  317. throw new UnsupportedOperationException( "Not supported yet." );
  318. }
  319. @Override
  320. public int getBeanDefinitionCount()
  321. {
  322. throw new UnsupportedOperationException( "Not supported yet." );
  323. }
  324. @Override
  325. public String[] getBeanDefinitionNames()
  326. {
  327. throw new UnsupportedOperationException( "Not supported yet." );
  328. }
  329. @Override
  330. public <T> ObjectProvider<T> getBeanProvider( Class<T> aClass, boolean b )
  331. {
  332. return null;
  333. }
  334. @Override
  335. public <T> ObjectProvider<T> getBeanProvider( ResolvableType resolvableType, boolean b )
  336. {
  337. return null;
  338. }
  339. @Override
  340. public String[] getBeanNamesForType( Class type )
  341. {
  342. throw new UnsupportedOperationException( "Not supported yet." );
  343. }
  344. @Override
  345. public String[] getBeanNamesForType( Class type, boolean includeNonSingletons, boolean allowEagerInit )
  346. {
  347. throw new UnsupportedOperationException( "Not supported yet." );
  348. }
  349. @Override
  350. public <T> T getBean( Class<T> aClass, Object... objects )
  351. throws BeansException
  352. {
  353. throw new UnsupportedOperationException( "Not supported yet." );
  354. }
  355. @Override
  356. public <T> ObjectProvider<T> getBeanProvider( Class<T> aClass )
  357. {
  358. return null;
  359. }
  360. @Override
  361. public <T> ObjectProvider<T> getBeanProvider( ResolvableType resolvableType )
  362. {
  363. return null;
  364. }
  365. @SuppressWarnings( "unchecked" )
  366. @Override
  367. public <T> Map<String, T> getBeansOfType( Class<T> type )
  368. throws BeansException
  369. {
  370. List<T> list = null;
  371. if (type == KnownRepositoryContentConsumer.class) {
  372. list = (List<T>) knownRepositoryContentConsumer;
  373. } else if (type == InvalidRepositoryContentConsumer.class) {
  374. list = (List<T>) invalidRepositoryContentConsumers;
  375. }
  376. if (list!=null) {
  377. return getConversionFunction( type ).apply( list );
  378. }
  379. throw new UnsupportedOperationException( "Should not have been called" );
  380. }
  381. @Override
  382. public <T> Map<String, T> getBeansOfType( Class<T> type, boolean includeNonSingletons, boolean allowEagerInit )
  383. throws BeansException
  384. {
  385. throw new UnsupportedOperationException( "Not supported yet." );
  386. }
  387. @Override
  388. public boolean containsBean( String name )
  389. {
  390. throw new UnsupportedOperationException( "Not supported yet." );
  391. }
  392. @Override
  393. public String[] getAliases( String name )
  394. {
  395. throw new UnsupportedOperationException( "Not supported yet." );
  396. }
  397. @Override
  398. public Object getBean( String name )
  399. throws BeansException
  400. {
  401. throw new UnsupportedOperationException( "Not supported yet." );
  402. }
  403. @Override
  404. public <T> T getBean( String name, Class<T> requiredType )
  405. throws BeansException
  406. {
  407. throw new UnsupportedOperationException( "Not supported yet." );
  408. }
  409. @Override
  410. public Object getBean( String name, Object[] args )
  411. throws BeansException
  412. {
  413. throw new UnsupportedOperationException( "Not supported yet." );
  414. }
  415. @Override
  416. public Class getType( String name )
  417. throws NoSuchBeanDefinitionException
  418. {
  419. throw new UnsupportedOperationException( "Not supported yet." );
  420. }
  421. @Override
  422. public Class<?> getType( String s, boolean b ) throws NoSuchBeanDefinitionException
  423. {
  424. return null;
  425. }
  426. @Override
  427. public boolean isPrototype( String name )
  428. throws NoSuchBeanDefinitionException
  429. {
  430. throw new UnsupportedOperationException( "Not supported yet." );
  431. }
  432. @Override
  433. public boolean isSingleton( String name )
  434. throws NoSuchBeanDefinitionException
  435. {
  436. throw new UnsupportedOperationException( "Not supported yet." );
  437. }
  438. @Override
  439. public boolean isTypeMatch( String name, Class targetType )
  440. throws NoSuchBeanDefinitionException
  441. {
  442. throw new UnsupportedOperationException( "Not supported yet." );
  443. }
  444. @Override
  445. public boolean containsLocalBean( String name )
  446. {
  447. throw new UnsupportedOperationException( "Not supported yet." );
  448. }
  449. @Override
  450. public BeanFactory getParentBeanFactory()
  451. {
  452. throw new UnsupportedOperationException( "Not supported yet." );
  453. }
  454. @Override
  455. public String getMessage( String code, Object[] args, String defaultMessage, Locale locale )
  456. {
  457. throw new UnsupportedOperationException( "Not supported yet." );
  458. }
  459. @Override
  460. public String getMessage( String code, Object[] args, Locale locale )
  461. throws NoSuchMessageException
  462. {
  463. throw new UnsupportedOperationException( "Not supported yet." );
  464. }
  465. @Override
  466. public String getMessage( MessageSourceResolvable resolvable, Locale locale )
  467. throws NoSuchMessageException
  468. {
  469. throw new UnsupportedOperationException( "Not supported yet." );
  470. }
  471. @Override
  472. public void publishEvent( ApplicationEvent event )
  473. {
  474. throw new UnsupportedOperationException( "Not supported yet." );
  475. }
  476. @Override
  477. public Resource[] getResources( String locationPattern )
  478. throws IOException
  479. {
  480. throw new UnsupportedOperationException( "Not supported yet." );
  481. }
  482. @Override
  483. public ClassLoader getClassLoader()
  484. {
  485. throw new UnsupportedOperationException( "Not supported yet." );
  486. }
  487. @Override
  488. public Resource getResource( String location )
  489. {
  490. throw new UnsupportedOperationException( "Not supported yet." );
  491. }
  492. @Override
  493. public <T> T getBean( Class<T> tClass )
  494. throws BeansException
  495. {
  496. throw new UnsupportedOperationException( "Not supported yet." );
  497. }
  498. @Override
  499. public Map<String, Object> getBeansWithAnnotation( Class<? extends Annotation> aClass )
  500. throws BeansException
  501. {
  502. throw new UnsupportedOperationException( "Not supported yet." );
  503. }
  504. @Override
  505. public <A extends Annotation> A findAnnotationOnBean( String s, Class<A> aClass )
  506. {
  507. throw new UnsupportedOperationException( "Not supported yet." );
  508. }
  509. @Override
  510. public Environment getEnvironment()
  511. {
  512. return null;
  513. }
  514. @Override
  515. public String[] getBeanNamesForAnnotation( Class<? extends Annotation> aClass )
  516. {
  517. return new String[0];
  518. }
  519. @Override
  520. public void publishEvent( Object o )
  521. {
  522. // no op
  523. }
  524. @Override
  525. public String[] getBeanNamesForType( ResolvableType resolvableType )
  526. {
  527. return new String[0];
  528. }
  529. @Override
  530. public String[] getBeanNamesForType( ResolvableType resolvableType, boolean b, boolean b1 )
  531. {
  532. return new String[0];
  533. }
  534. @Override
  535. public boolean isTypeMatch( String s, ResolvableType resolvableType )
  536. throws NoSuchBeanDefinitionException
  537. {
  538. return false;
  539. }
  540. }
  541. }