Пример #1
0
 @Before
 @SuppressWarnings("unchecked")
 public void setup() {
   tester = new WicketTester();
   AnnotApplicationContextMock context = new AnnotApplicationContextMock();
   tester
       .getApplication()
       .addComponentInstantiationListener(
           new SpringComponentInjector(tester.getApplication(), context, false));
   eventService = mock(WorkflowService.class);
   RuleManager ruleManager = mock(RuleManager.class);
   domain = mock(AuditingDomain.class);
   Mockito.when(domain.getAudits()).thenReturn(Arrays.asList(new String[] {"123", "456"}));
   context.putBean(ruleManager);
   context.putBean("eventService", eventService);
   context.putBean("domainService", mock(DomainService.class));
   context.putBean("contextCurrentService", mock(ContextCurrentService.class));
   context.putBean("openengsbVersion", new OpenEngSBVersion());
   context.putBean("audit", domain);
   eventClasses =
       Arrays.<Class<? extends Event>>asList(NullEvent2.class, NullEvent.class, BrokenEvent.class);
   tester.startPage(new SendEventPage(eventClasses));
   fieldList =
       (RepeatingView) tester.getComponentFromLastRenderedPage("form:fieldContainer:fields");
   dropdown = (DropDownChoice<Class<?>>) tester.getComponentFromLastRenderedPage("form:dropdown");
   formTester = tester.newFormTester("form");
 }
Пример #2
0
 @Test
 public void openSite_shouldShowAuditLog() {
   tester.assertVisible("auditsContainer:audits");
   tester.assertVisible("auditsContainer:audits:0:audit");
   tester.assertVisible("auditsContainer:audits:1:audit");
   int i = 0;
   for (String string : domain.getAudits()) {
     tester.assertLabel("auditsContainer:audits:" + i + ":audit", string);
     i++;
   }
 }