@Test public void isActive() throws Exception { DocumentReference configClass1 = new DocumentReference("wiki1", "XWiki", "MessageStreamConfig"); Mockito.when(documentAccessBridge.getProperty(configClass1, configClass1, "active")).thenReturn(1); DocumentReference configClass2 = new DocumentReference("wiki2", "XWiki", "MessageStreamConfig"); Mockito.when(documentAccessBridge.getProperty(configClass2, configClass2, "active")).thenReturn(0); DocumentReference configClass3 = new DocumentReference("wiki3", "XWiki", "MessageStreamConfig"); Mockito.when(documentAccessBridge.getProperty(configClass3, configClass3, "active")).thenReturn(null); assertTrue(mocker.getComponentUnderTest().isActive("wiki1")); assertFalse(mocker.getComponentUnderTest().isActive("wiki2")); assertFalse(mocker.getComponentUnderTest().isActive("wiki3")); }
@Override public boolean isActive(String wikiId) { DocumentReference configPage = new DocumentReference(wikiId, "XWiki", "MessageStreamConfig"); return Integer.valueOf(1).equals(documentAccessBridge.getProperty(configPage, configPage, "active")); }
DefaultMessageStreamConfiguration implements MessageStreamConfiguration { @Override public boolean isActive(String wikiId) { DocumentReference configPage = new DocumentReference(wikiId, "XWiki", "MessageStreamConfig"); return Integer.valueOf(1).equals(documentAccessBridge.getProperty(configPage, configPage, "active")); } }
DefaultMessageStreamConfiguration implements MessageStreamConfiguration { @Override public boolean isActive(String wikiId) { DocumentReference configPage = new DocumentReference(wikiId, "XWiki", "MessageStreamConfig"); return Integer.valueOf(1).equals(documentAccessBridge.getProperty(configPage, configPage, "active")); }  }
DefaultMessageStreamConfiguration implements MessageStreamConfiguration { @Override public boolean isActive(String wikiId) { DocumentReference configPage = new DocumentReference(wikiId, "XWiki", "MessageStreamConfig"); return Integer.valueOf(1).equals(documentAccessBridge.getProperty(configPage, configPage, "active")); }  @Override boolean isActive(String wikiId); }
DefaultMessageStreamConfiguration implements MessageStreamConfiguration { @Override public boolean isActive(String wikiId) { DocumentReference configPage = new DocumentReference(wikiId, "XWiki", "MessageStreamConfig"); return Integer.valueOf(1).equals(documentAccessBridge.getProperty(configPage, configPage, "active")); }  @Override boolean isActive(String wikiId);  }