@Test public void get() { List<RepositoryAnnotator> expected = new ArrayList<RepositoryAnnotator>(); expected.add(annotator2); expected.add(annotator3); assertEquals(annotationService.getAnnotatorsByMetaData(metaData), expected); }
@BeforeMethod public void beforeMethod() { annotationService = new AnnotationServiceImpl(); metaData = mock(EntityMetaData.class); annotator1 = mock(RepositoryAnnotator.class); when(annotator1.getName()).thenReturn("annotator1"); when(annotator1.canAnnotate(metaData)).thenReturn(false); annotationService.addAnnotator(annotator1); annotator2 = mock(RepositoryAnnotator.class); when(annotator2.getName()).thenReturn("annotator2"); when(annotator2.canAnnotate(metaData)).thenReturn(true); annotationService.addAnnotator(annotator2); annotator3 = mock(RepositoryAnnotator.class); when(annotator3.getName()).thenReturn("annotator3"); when(annotator3.canAnnotate(metaData)).thenReturn(true); annotationService.addAnnotator(annotator3); }
@Test public void getRepositoryByEntityName() { assertEquals(annotationService.getAnnotatorByName("annotator1"), annotator1); assertEquals(annotationService.getAnnotatorByName("annotator2"), annotator2); assertEquals(annotationService.getAnnotatorByName("annotator3"), annotator3); }
@Test public void getAllAnnotators() { assertNotNull(annotationService.getAllAnnotators()); List<RepositoryAnnotator> it = annotationService.getAllAnnotators(); }