target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testCloseShutdownCommitTask() throws InterruptedException { m_storageService.close(); assertTrue("Storage service scheduler can't be stopped in 3 seconds", m_storageService.m_scheduler.awaitTermination(3, TimeUnit.SECONDS)); assertTrue(m_storageService.m_scheduler.isTerminated()); }
@Override public void close() { if (this.m_db.isClosed()) { LOG.warn("MapDB store is already closed. Nothing will be done"); return; } LOG.info("Performing last commit to MapDB"); this.m_db.commit(); LOG.info("Closing MapDB store"); this.m_db.close(); LOG.info("Stopping MapDB commit tasks"); this.m_scheduler.shutdown()...
MapDBPersistentStore implements IStore { @Override public void close() { if (this.m_db.isClosed()) { LOG.warn("MapDB store is already closed. Nothing will be done"); return; } LOG.info("Performing last commit to MapDB"); this.m_db.commit(); LOG.info("Closing MapDB store"); this.m_db.close(); LOG.info("Stopping MapDB co...
MapDBPersistentStore implements IStore { @Override public void close() { if (this.m_db.isClosed()) { LOG.warn("MapDB store is already closed. Nothing will be done"); return; } LOG.info("Performing last commit to MapDB"); this.m_db.commit(); LOG.info("Closing MapDB store"); this.m_db.close(); LOG.info("Stopping MapDB co...
MapDBPersistentStore implements IStore { @Override public void close() { if (this.m_db.isClosed()) { LOG.warn("MapDB store is already closed. Nothing will be done"); return; } LOG.info("Performing last commit to MapDB"); this.m_db.commit(); LOG.info("Closing MapDB store"); this.m_db.close(); LOG.info("Stopping MapDB co...
MapDBPersistentStore implements IStore { @Override public void close() { if (this.m_db.isClosed()) { LOG.warn("MapDB store is already closed. Nothing will be done"); return; } LOG.info("Performing last commit to MapDB"); this.m_db.commit(); LOG.info("Closing MapDB store"); this.m_db.close(); LOG.info("Stopping MapDB co...
@Test public void testSubscribe() { MqttSubscribeMessage msg = MqttMessageBuilders.subscribe().addSubscription(MqttQoS.AT_MOST_ONCE, FAKE_TOPIC) .messageId(10).build(); m_sessionStore.createNewSession(FAKE_CLIENT_ID, false); m_processor.processSubscribe(m_channel, msg); assertTrue(m_channel.readOutbound() instanceof Mq...
public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(clientID, messageID); ...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
@Test public void testDoubleSubscribe() { MqttSubscribeMessage msg = MqttMessageBuilders.subscribe().addSubscription(MqttQoS.AT_MOST_ONCE, FAKE_TOPIC) .messageId(10).build(); m_sessionStore.createNewSession(FAKE_CLIENT_ID, false); assertEquals(0, subscriptions.size()); m_processor.processSubscribe(m_channel, msg); asse...
public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(clientID, messageID); ...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
@Test public void testSubscribeWithBadFormattedTopic() { MqttSubscribeMessage msg = MqttMessageBuilders.subscribe().addSubscription(MqttQoS.AT_MOST_ONCE, BAD_FORMATTED_TOPIC) .messageId(10).build(); m_sessionStore.createNewSession(FAKE_CLIENT_ID, false); assertEquals(0, subscriptions.size()); m_processor.processSubscri...
public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(clientID, messageID); ...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
ProtocolProcessor { public void processSubscribe(Channel channel, MqttSubscribeMessage msg) { String clientID = NettyUtils.clientID(channel); int messageID = messageId(msg); LOG.info("Processing SUBSCRIBE message. CId={}, messageId={}", clientID, messageID); RunningSubscription executionKey = new RunningSubscription(cl...
@Test public void testUnsubscribeWithBadFormattedTopic() { MqttUnsubscribeMessage msg = MqttMessageBuilders.unsubscribe().addTopicFilter(BAD_FORMATTED_TOPIC).messageId(1) .build(); m_processor.processUnsubscribe(m_channel, msg); assertFalse("If client unsubscribe with bad topic than channel must be closed", m_channel.i...
public void processUnsubscribe(Channel channel, MqttUnsubscribeMessage msg) { List<String> topics = msg.payload().topics(); String clientID = NettyUtils.clientID(channel); LOG.info("Processing UNSUBSCRIBE message. CId={}, topics={}", clientID, topics); ClientSession clientSession = m_sessionsStore.sessionForClient(clie...
ProtocolProcessor { public void processUnsubscribe(Channel channel, MqttUnsubscribeMessage msg) { List<String> topics = msg.payload().topics(); String clientID = NettyUtils.clientID(channel); LOG.info("Processing UNSUBSCRIBE message. CId={}, topics={}", clientID, topics); ClientSession clientSession = m_sessionsStore.s...
ProtocolProcessor { public void processUnsubscribe(Channel channel, MqttUnsubscribeMessage msg) { List<String> topics = msg.payload().topics(); String clientID = NettyUtils.clientID(channel); LOG.info("Processing UNSUBSCRIBE message. CId={}, topics={}", clientID, topics); ClientSession clientSession = m_sessionsStore.s...
ProtocolProcessor { public void processUnsubscribe(Channel channel, MqttUnsubscribeMessage msg) { List<String> topics = msg.payload().topics(); String clientID = NettyUtils.clientID(channel); LOG.info("Processing UNSUBSCRIBE message. CId={}, topics={}", clientID, topics); ClientSession clientSession = m_sessionsStore.s...
ProtocolProcessor { public void processUnsubscribe(Channel channel, MqttUnsubscribeMessage msg) { List<String> topics = msg.payload().topics(); String clientID = NettyUtils.clientID(channel); LOG.info("Processing UNSUBSCRIBE message. CId={}, topics={}", clientID, topics); ClientSession clientSession = m_sessionsStore.s...
@Test public void testLowerTheQosToTheRequestedBySubscription() { Subscription subQos1 = new Subscription("Sub A", new Topic("a/b"), MqttQoS.AT_LEAST_ONCE); assertEquals(MqttQoS.AT_LEAST_ONCE, lowerQosToTheSubscriptionDesired(subQos1, MqttQoS.EXACTLY_ONCE)); Subscription subQos2 = new Subscription("Sub B", new Topic("a...
static MqttQoS lowerQosToTheSubscriptionDesired(Subscription sub, MqttQoS qos) { if (qos.value() > sub.getRequestedQos().value()) { qos = sub.getRequestedQos(); } return qos; }
ProtocolProcessor { static MqttQoS lowerQosToTheSubscriptionDesired(Subscription sub, MqttQoS qos) { if (qos.value() > sub.getRequestedQos().value()) { qos = sub.getRequestedQos(); } return qos; } }
ProtocolProcessor { static MqttQoS lowerQosToTheSubscriptionDesired(Subscription sub, MqttQoS qos) { if (qos.value() > sub.getRequestedQos().value()) { qos = sub.getRequestedQos(); } return qos; } ProtocolProcessor(); }
ProtocolProcessor { static MqttQoS lowerQosToTheSubscriptionDesired(Subscription sub, MqttQoS qos) { if (qos.value() > sub.getRequestedQos().value()) { qos = sub.getRequestedQos(); } return qos; } ProtocolProcessor(); void init(SubscriptionsDirectory subscriptions, IMessagesStore storageService, ISessionsStore sessions...
ProtocolProcessor { static MqttQoS lowerQosToTheSubscriptionDesired(Subscription sub, MqttQoS qos) { if (qos.value() > sub.getRequestedQos().value()) { qos = sub.getRequestedQos(); } return qos; } ProtocolProcessor(); void init(SubscriptionsDirectory subscriptions, IMessagesStore storageService, ISessionsStore sessions...
@Test public void Db_verifyValid() { final DBAuthenticator dbAuthenticator = new DBAuthenticator( ORG_H2_DRIVER, JDBC_H2_MEM_TEST, "SELECT PASSWORD FROM ACCOUNT WHERE LOGIN=?", SHA_256); assertTrue(dbAuthenticator.checkValid(null, "dbuser", "password".getBytes())); }
@Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username); r = this.preparedStatement.executeQuery();...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
@Test public void Db_verifyInvalidLogin() { final DBAuthenticator dbAuthenticator = new DBAuthenticator( ORG_H2_DRIVER, JDBC_H2_MEM_TEST, "SELECT PASSWORD FROM ACCOUNT WHERE LOGIN=?", SHA_256); assertFalse(dbAuthenticator.checkValid(null, "dbuser2", "password".getBytes())); }
@Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username); r = this.preparedStatement.executeQuery();...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
@Test public void Db_verifyInvalidPassword() { final DBAuthenticator dbAuthenticator = new DBAuthenticator( ORG_H2_DRIVER, JDBC_H2_MEM_TEST, "SELECT PASSWORD FROM ACCOUNT WHERE LOGIN=?", SHA_256); assertFalse(dbAuthenticator.checkValid(null, "dbuser", "wrongPassword".getBytes())); }
@Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username); r = this.preparedStatement.executeQuery();...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
DBAuthenticator implements IAuthenticator { @Override public synchronized boolean checkValid(String clientId, String username, byte[] password) { if (username == null || password == null) { LOG.info("username or password was null"); return false; } ResultSet r = null; try { this.preparedStatement.setString(1, username)...
@Test public void testSupports() throws Exception { final Credential credential = mock(Credential.class); when(credential.getId()).thenReturn("a"); final PrincipalResolver resolver1 = mock(PrincipalResolver.class); when(resolver1.supports(eq(credential))).thenReturn(true); final PrincipalResolver resolver2 = mock(Princ...
public boolean supports(final Credential credential) { return this.chain.get(0).supports(credential); }
ChainingPrincipalResolver implements PrincipalResolver { public boolean supports(final Credential credential) { return this.chain.get(0).supports(credential); } }
ChainingPrincipalResolver implements PrincipalResolver { public boolean supports(final Credential credential) { return this.chain.get(0).supports(credential); } }
ChainingPrincipalResolver implements PrincipalResolver { public boolean supports(final Credential credential) { return this.chain.get(0).supports(credential); } void setChain(final List<PrincipalResolver> chain); Principal resolve(final Credential credential); boolean supports(final Credential credential); }
ChainingPrincipalResolver implements PrincipalResolver { public boolean supports(final Credential credential) { return this.chain.get(0).supports(credential); } void setChain(final List<PrincipalResolver> chain); Principal resolve(final Credential credential); boolean supports(final Credential credential); }
@Test public void testResolve() throws Exception { final Credential credential = mock(Credential.class); when(credential.getId()).thenReturn("input"); final PrincipalResolver resolver1 = mock(PrincipalResolver.class); when(resolver1.supports(eq(credential))).thenReturn(true); when(resolver1.resolve((eq(credential)))).t...
public Principal resolve(final Credential credential) { Principal result = null; Credential input = credential; for (final PrincipalResolver resolver : this.chain) { if (result != null) { input = new IdentifiableCredential(result.getId()); } result = resolver.resolve(input); } return result; }
ChainingPrincipalResolver implements PrincipalResolver { public Principal resolve(final Credential credential) { Principal result = null; Credential input = credential; for (final PrincipalResolver resolver : this.chain) { if (result != null) { input = new IdentifiableCredential(result.getId()); } result = resolver.res...
ChainingPrincipalResolver implements PrincipalResolver { public Principal resolve(final Credential credential) { Principal result = null; Credential input = credential; for (final PrincipalResolver resolver : this.chain) { if (result != null) { input = new IdentifiableCredential(result.getId()); } result = resolver.res...
ChainingPrincipalResolver implements PrincipalResolver { public Principal resolve(final Credential credential) { Principal result = null; Credential input = credential; for (final PrincipalResolver resolver : this.chain) { if (result != null) { input = new IdentifiableCredential(result.getId()); } result = resolver.res...
ChainingPrincipalResolver implements PrincipalResolver { public Principal resolve(final Credential credential) { Principal result = null; Credential input = credential; for (final PrincipalResolver resolver : this.chain) { if (result != null) { input = new IdentifiableCredential(result.getId()); } result = resolver.res...
@Test public void testAuthenticateSuccess() throws Exception { final HandlerResult result = alwaysPassHandler.authenticate(new UsernamePasswordCredential("a", "b")); assertEquals("TestAlwaysPassAuthenticationHandler", result.getHandlerName()); }
@Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (credential instanceof CredentialMetaData) { md = (CredentialMetaData) crede...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede...
@Test(expected = FailedLoginException.class) public void testAuthenticateFailure() throws Exception { alwaysFailHandler.authenticate(new UsernamePasswordCredential("a", "b")); }
@Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (credential instanceof CredentialMetaData) { md = (CredentialMetaData) crede...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData md; if (crede...
@Test public void testSupports() throws Exception { assertTrue(alwaysPassHandler.supports(new UsernamePasswordCredential("a", "b"))); assertTrue(alwaysFailHandler.supports(new UsernamePasswordCredential("a", "b"))); }
@Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); }
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } }
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } LegacyAuthenticationHandlerAdapter(final org.jasig.cas.authentication.handler.AuthenticationHandler legacy)...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } LegacyAuthenticationHandlerAdapter(final org.jasig.cas.authentication.handler.AuthenticationHandler legacy)...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } LegacyAuthenticationHandlerAdapter(final org.jasig.cas.authentication.handler.AuthenticationHandler legacy)...
@Test public void testGetName() throws Exception { assertEquals("TestAlwaysPassAuthenticationHandler", alwaysPassHandler.getName()); assertEquals("TestAlwaysFailAuthenticationHandler", alwaysFailHandler.getName()); }
@Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } }
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } }
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } LegacyAuthentic...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } LegacyAuthentic...
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } LegacyAuthentic...
@Test public void testAuthenticate() { assertNotNull(this.radiusServer); }
@Override public boolean authenticate(final String username, final String password) throws PreventedException { final AttributeList attributeList = new AttributeList(); attributeList.add(new Attr_UserName(username)); attributeList.add(new Attr_UserPassword(password)); RadiusClient client = null; try { client = this.rad...
JRadiusServerImpl implements RadiusServer { @Override public boolean authenticate(final String username, final String password) throws PreventedException { final AttributeList attributeList = new AttributeList(); attributeList.add(new Attr_UserName(username)); attributeList.add(new Attr_UserPassword(password)); RadiusC...
JRadiusServerImpl implements RadiusServer { @Override public boolean authenticate(final String username, final String password) throws PreventedException { final AttributeList attributeList = new AttributeList(); attributeList.add(new Attr_UserName(username)); attributeList.add(new Attr_UserPassword(password)); RadiusC...
JRadiusServerImpl implements RadiusServer { @Override public boolean authenticate(final String username, final String password) throws PreventedException { final AttributeList attributeList = new AttributeList(); attributeList.add(new Attr_UserName(username)); attributeList.add(new Attr_UserPassword(password)); RadiusC...
JRadiusServerImpl implements RadiusServer { @Override public boolean authenticate(final String username, final String password) throws PreventedException { final AttributeList attributeList = new AttributeList(); attributeList.add(new Attr_UserName(username)); attributeList.add(new Attr_UserPassword(password)); RadiusC...
@Test public void testCanHandle() { request.addParameter("openid.mode", "associate"); boolean canHandle = smartOpenIdController.canHandle(request, response); request.removeParameter("openid.mode"); assertEquals(true, canHandle); }
@Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling request. openid.mode : {}", openIdMode); return true; } logger.info("Canno...
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling...
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling...
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling...
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling...
@Test public void testCannotHandle() { request.addParameter("openid.mode", "anythingElse"); boolean canHandle = smartOpenIdController.canHandle(request, response); request.removeParameter("openid.mode"); assertEquals(false, canHandle); }
@Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling request. openid.mode : {}", openIdMode); return true; } logger.info("Canno...
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling...
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling...
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling...
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { String openIdMode = request.getParameter("openid.mode"); if (openIdMode != null && openIdMode.equals("associate")) { logger.info("Handling...
@Test public void testGetAssociationResponse() { request.addParameter("openid.mode", "associate"); request.addParameter("openid.session_type", "DH-SHA1"); request.addParameter("openid.assoc_type", "HMAC-SHA1"); request.addParameter("openid.dh_consumer_public", "NzKoFMyrzFn/5iJFPdX6MVvNA/BChV1/sJdnYbupDn7ptn+cerwEzyFfWF...
public Map<String, String> getAssociationResponse(final HttpServletRequest request) { ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter("openid.mode") ? parameters.getParameterValue("openid.mode") : null; Message response = null; if (mode != null && mod...
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter("openid.mode") ? parameters.getParameterVa...
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter("openid.mode") ? parameters.getParameterVa...
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter("openid.mode") ? parameters.getParameterVa...
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter("openid.mode") ? parameters.getParameterVa...
@Test public void shouldReturnFalseIfHasNoRegistrationDiscriminator() { AvailableForm availableForm = new AvailableForm(); assertFalse(availableForm.isRegistrationForm()); for(String discriminator: nonRegistrationDiscriminators) { availableForm.setDiscriminator(discriminator); assertFalse(availableForm.isRegistrationFo...
public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FO...
AvailableForm extends BaseForm { public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(ge...
AvailableForm extends BaseForm { public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(ge...
AvailableForm extends BaseForm { public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(ge...
AvailableForm extends BaseForm { public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(ge...
@Test public void getAllFormData_shouldReturnListOfAllFormDatas() throws Exception, FormController.FormDataFetchException { FormData formData = new FormData(); String status = "draft"; when(formService.getAllFormData(status)).thenReturn(Collections.singletonList(formData)); assertThat(formController.getAllFormData(stat...
public List<FormData> getAllFormData(String status) throws FormDataFetchException { try { return formService.getAllFormData(status); } catch (Exception e) { throw new FormDataFetchException(e); } }
FormController { public List<FormData> getAllFormData(String status) throws FormDataFetchException { try { return formService.getAllFormData(status); } catch (Exception e) { throw new FormDataFetchException(e); } } }
FormController { public List<FormData> getAllFormData(String status) throws FormDataFetchException { try { return formService.getAllFormData(status); } catch (Exception e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); }
FormController { public List<FormData> getAllFormData(String status) throws FormDataFetchException { try { return formService.getAllFormData(status); } catch (Exception e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String f...
FormController { public List<FormData> getAllFormData(String status) throws FormDataFetchException { try { return formService.getAllFormData(status); } catch (Exception e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication); int getTotalFormCount(); Form getFormByUuid(String f...
@Test public void getAllFormDataByPatientUuid_shouldReturnAllFormDataForPatientAndGivenStatus() throws Exception, FormController.FormDataFetchException { List<FormData> formDataList = new ArrayList<>(); String patientUuid = "patientUuid"; String status = "status"; when(formService.getFormDataByPatient(patientUuid, stat...
public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } }
FormController { public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } } }
FormController { public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication)...
FormController { public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication)...
FormController { public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication)...
@Test (expected = FormController.FormDataFetchException.class) public void getAllFormDataByPatientUuid_shouldThrowFormDataFetchExpetionIfExceptionThrownByService() throws Exception, FormController.FormDataFetchException { doThrow(new IOException()).when(formService).getFormDataByPatient(anyString(), anyString()); formC...
public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } }
FormController { public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } } }
FormController { public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication)...
FormController { public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication)...
FormController { public List<FormData> getAllFormDataByPatientUuid(String patientUuid, String status) throws FormDataFetchException { try { return formService.getFormDataByPatient(patientUuid, status); } catch (IOException e) { throw new FormDataFetchException(e); } } FormController(MuzimaApplication muzimaApplication)...
@Test (expected = FormController.FormFetchException.class) public void getAllCompleteFormsForPatientUuid_shouldThrowFormFetchExceptionIfExceptionThrownByService() throws Exception, FormController.FormFetchException { doThrow(new IOException()).when(formService).getFormDataByPatient(anyString(),anyString()); formControl...
public CompleteForms getAllCompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { CompleteForms completePatientForms = new CompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_COMPLETE); for (FormData formData : allFormData) { Form form ...
FormController { public CompleteForms getAllCompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { CompleteForms completePatientForms = new CompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_COMPLETE); for (FormData formData : allFormD...
FormController { public CompleteForms getAllCompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { CompleteForms completePatientForms = new CompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_COMPLETE); for (FormData formData : allFormD...
FormController { public CompleteForms getAllCompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { CompleteForms completePatientForms = new CompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_COMPLETE); for (FormData formData : allFormD...
FormController { public CompleteForms getAllCompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { CompleteForms completePatientForms = new CompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_COMPLETE); for (FormData formData : allFormD...
@Test (expected = FormController.FormFetchException.class) public void getAllIncompleteFormsForPatientUuid_shouldThrowFormFetchExceptionIfExceptionThrownByService() throws Exception, FormController.FormFetchException { doThrow(new IOException()).when(formService).getFormDataByPatient(anyString(),anyString()); formContr...
public IncompleteForms getAllIncompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { IncompleteForms incompleteForms = new IncompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_INCOMPLETE); for (FormData formData : allFormData) { incom...
FormController { public IncompleteForms getAllIncompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { IncompleteForms incompleteForms = new IncompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_INCOMPLETE); for (FormData formData : all...
FormController { public IncompleteForms getAllIncompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { IncompleteForms incompleteForms = new IncompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_INCOMPLETE); for (FormData formData : all...
FormController { public IncompleteForms getAllIncompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { IncompleteForms incompleteForms = new IncompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_INCOMPLETE); for (FormData formData : all...
FormController { public IncompleteForms getAllIncompleteFormsForPatientUuid(String patientUuid) throws FormFetchException { IncompleteForms incompleteForms = new IncompleteForms(); try { List<FormData> allFormData = formService.getFormDataByPatient(patientUuid, Constants.STATUS_INCOMPLETE); for (FormData formData : all...
@Test public void shouldFilterOutUploadedFormData() throws Exception, FormController.FormDataFetchException { String templateUUID = "templateUUID"; when(formService.getFormDataByTemplateUUID(templateUUID)).thenReturn(asList( formDataWithStatusAndDiscriminator(Constants.STATUS_COMPLETE, Constants.FORM_XML_DISCRIMINATOR_...
public List<FormData> getNonUploadedFormData(String templateUUID) throws FormDataFetchException { List<FormData> incompleteFormData = new ArrayList<>(); try { List<FormData> formDataByTemplateUUID = formService.getFormDataByTemplateUUID(templateUUID); for (FormData formData : formDataByTemplateUUID) { if (!formData.get...
FormController { public List<FormData> getNonUploadedFormData(String templateUUID) throws FormDataFetchException { List<FormData> incompleteFormData = new ArrayList<>(); try { List<FormData> formDataByTemplateUUID = formService.getFormDataByTemplateUUID(templateUUID); for (FormData formData : formDataByTemplateUUID) { ...
FormController { public List<FormData> getNonUploadedFormData(String templateUUID) throws FormDataFetchException { List<FormData> incompleteFormData = new ArrayList<>(); try { List<FormData> formDataByTemplateUUID = formService.getFormDataByTemplateUUID(templateUUID); for (FormData formData : formDataByTemplateUUID) { ...
FormController { public List<FormData> getNonUploadedFormData(String templateUUID) throws FormDataFetchException { List<FormData> incompleteFormData = new ArrayList<>(); try { List<FormData> formDataByTemplateUUID = formService.getFormDataByTemplateUUID(templateUUID); for (FormData formData : formDataByTemplateUUID) { ...
FormController { public List<FormData> getNonUploadedFormData(String templateUUID) throws FormDataFetchException { List<FormData> incompleteFormData = new ArrayList<>(); try { List<FormData> formDataByTemplateUUID = formService.getFormDataByTemplateUUID(templateUUID); for (FormData formData : formDataByTemplateUUID) { ...
@Test public void shouldSearchOnServerForLocationsByNames() throws Exception, LocationController.LocationDownloadException { String name = "name"; List<Location> locations = new ArrayList<>(); when(locationService.downloadLocationsByName(name)).thenReturn(locations); assertThat(locationController.downloadLocationFromSe...
public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDownloadException(e); }...
LocationController { public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDo...
LocationController { public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDo...
LocationController { public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDo...
LocationController { public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDo...
@Test public void shouldSearchOnServerForLocationByUuid() throws Exception, LocationController.LocationDownloadException { String uuid = "uuid"; Location location = new Location(); when(locationService.downloadLocationByUuid(uuid)).thenReturn(location); assertThat(locationController.downloadLocationFromServerByUuid(uui...
public Location downloadLocationFromServerByUuid(String uuid) throws LocationDownloadException { try { return locationService.downloadLocationByUuid(uuid); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDownloadException(e); } }
LocationController { public Location downloadLocationFromServerByUuid(String uuid) throws LocationDownloadException { try { return locationService.downloadLocationByUuid(uuid); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDownloadE...
LocationController { public Location downloadLocationFromServerByUuid(String uuid) throws LocationDownloadException { try { return locationService.downloadLocationByUuid(uuid); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDownloadE...
LocationController { public Location downloadLocationFromServerByUuid(String uuid) throws LocationDownloadException { try { return locationService.downloadLocationByUuid(uuid); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDownloadE...
LocationController { public Location downloadLocationFromServerByUuid(String uuid) throws LocationDownloadException { try { return locationService.downloadLocationByUuid(uuid); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDownloadE...
@Test public void getAllLocations_shouldReturnAllAvailableLocations() throws IOException, LocationController.LocationLoadException { List<Location> locations = new ArrayList<>(); when(locationService.getAllLocations()).thenReturn(locations); assertThat(locationController.getAllLocations(), is(locations)); }
public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } }
LocationController { public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } } }
LocationController { public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); }
LocationController { public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); List<Location> downloadLocationFromServerByName(String name);...
LocationController { public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); List<Location> downloadLocationFromServerByName(String name);...
@Test(expected = LocationController.LocationLoadException.class) public void getAllLocations_shouldThrowLoLocationFetchExceptionIfExceptionThrownByLocationService() throws IOException, LocationController.LocationLoadException { doThrow(new IOException()).when(locationService).getAllLocations(); locationController.getAl...
public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } }
LocationController { public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } } }
LocationController { public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); }
LocationController { public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); List<Location> downloadLocationFromServerByName(String name);...
LocationController { public List<Location> getAllLocations() throws LocationLoadException { try { return locationService.getAllLocations(); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); List<Location> downloadLocationFromServerByName(String name);...
@Test public void authenticate_shouldCallCloseSessionIfAuthenticationSucceed() { String[] credentials = new String[]{"username", "password", "url"}; muzimaSyncService.authenticate(credentials); verify(muzimaContext).closeSession(); }
public int authenticate(String[] credentials) { return authenticate(credentials, false); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
@Test public void getLocationByUuid_shouldReturnLocationForId() throws Exception, LocationController.LocationLoadException { Location location = new Location(); String uuid = "uuid"; when(locationService.getLocationByUuid(uuid)).thenReturn(location); assertThat(locationController.getLocationByUuid(uuid), is(location));...
public Location getLocationByUuid(String uuid) throws LocationLoadException { try { return locationService.getLocationByUuid(uuid); } catch (IOException e) { throw new LocationLoadException(e); } }
LocationController { public Location getLocationByUuid(String uuid) throws LocationLoadException { try { return locationService.getLocationByUuid(uuid); } catch (IOException e) { throw new LocationLoadException(e); } } }
LocationController { public Location getLocationByUuid(String uuid) throws LocationLoadException { try { return locationService.getLocationByUuid(uuid); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); }
LocationController { public Location getLocationByUuid(String uuid) throws LocationLoadException { try { return locationService.getLocationByUuid(uuid); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); List<Location> downloadLocationFromServerByName(...
LocationController { public Location getLocationByUuid(String uuid) throws LocationLoadException { try { return locationService.getLocationByUuid(uuid); } catch (IOException e) { throw new LocationLoadException(e); } } LocationController(LocationService locationService); List<Location> downloadLocationFromServerByName(...
@Test(expected = LocationController.LocationDownloadException.class) public void shouldReturnEmptyListIsExceptionThrown() throws Exception, LocationController.LocationDownloadException { String searchString = "name"; doThrow(new IOException()).when(locationService).downloadLocationsByName(searchString); assertThat(loca...
public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDownloadException(e); }...
LocationController { public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDo...
LocationController { public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDo...
LocationController { public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDo...
LocationController { public List<Location> downloadLocationFromServerByName(String name) throws LocationDownloadException { try { return locationService.downloadLocationsByName(name); } catch (IOException e) { Log.e(getClass().getSimpleName(), "Error while searching for patients in the server", e); throw new LocationDo...
@Test public void shouldDownloadConceptUsingNonPreferredName() throws Exception, ConceptController.ConceptDownloadException { List<Concept> concepts = new ArrayList<>(); final String nonPreferredName = "NonPreferredName"; Concept aConcept = new Concept() {{ setConceptNames(new ArrayList<ConceptName>() {{ add(new Concep...
public List<Concept> downloadConceptsByNames(List<String> names) throws ConceptDownloadException { HashSet<Concept> result = new HashSet<>(); for (String name : names) { List<Concept> concepts = downloadConceptsByNamePrefix(name); Iterator<Concept> iterator = concepts.iterator(); while (iterator.hasNext()) { Concept ne...
ConceptController { public List<Concept> downloadConceptsByNames(List<String> names) throws ConceptDownloadException { HashSet<Concept> result = new HashSet<>(); for (String name : names) { List<Concept> concepts = downloadConceptsByNamePrefix(name); Iterator<Concept> iterator = concepts.iterator(); while (iterator.has...
ConceptController { public List<Concept> downloadConceptsByNames(List<String> names) throws ConceptDownloadException { HashSet<Concept> result = new HashSet<>(); for (String name : names) { List<Concept> concepts = downloadConceptsByNamePrefix(name); Iterator<Concept> iterator = concepts.iterator(); while (iterator.has...
ConceptController { public List<Concept> downloadConceptsByNames(List<String> names) throws ConceptDownloadException { HashSet<Concept> result = new HashSet<>(); for (String name : names) { List<Concept> concepts = downloadConceptsByNamePrefix(name); Iterator<Concept> iterator = concepts.iterator(); while (iterator.has...
ConceptController { public List<Concept> downloadConceptsByNames(List<String> names) throws ConceptDownloadException { HashSet<Concept> result = new HashSet<>(); for (String name : names) { List<Concept> concepts = downloadConceptsByNamePrefix(name); Iterator<Concept> iterator = concepts.iterator(); while (iterator.has...
@Test public void shouldReturnAConceptThatMatchesNameExactly() throws Exception, ConceptController.ConceptFetchException { String conceptName = "conceptName"; List<Concept> conceptList = asList(createConceptByName("someName"),createConceptByName(conceptName)); when(service.getConceptsByName(conceptName)).thenReturn(con...
public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e); } return null; }
ConceptController { public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e)...
ConceptController { public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e)...
ConceptController { public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e)...
ConceptController { public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e)...
@Test public void shouldReturnNullIfNoConceptMatchesTheName() throws Exception, ConceptController.ConceptFetchException { String conceptName = "conceptName"; List<Concept> conceptList = asList(createConceptByName("someName"),createConceptByName("someOtherName")); when(service.getConceptsByName(conceptName)).thenReturn(...
public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e); } return null; }
ConceptController { public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e)...
ConceptController { public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e)...
ConceptController { public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e)...
ConceptController { public Concept getConceptByName(String name) throws ConceptFetchException { try { List<Concept> concepts = conceptService.getConceptsByName(name); for (Concept concept : concepts) { if (concept.getName().equals(name)) { return concept; } } } catch (IOException e) { throw new ConceptFetchException(e)...
@Test public void shouldCheckLastSyncTimeBeforeDownloadingObservations() throws Exception, ObservationController.DownloadObservationException { List<String> patientUuids = asList("PatientUuid1", "PatientUuid2"); List<String> conceptUuids = asList("ConceptUuid1", "ConceptUuid2"); Date aDate = mock(Date.class); when(last...
public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_OBSERV...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
@Test public void shouldUseLastSyncTimeToDownloadObservations() throws Exception, ObservationController.DownloadObservationException { List<String> patientUuids = asList("PatientUuid1", "PatientUuid2"); List<String> conceptUuids = asList("ConceptUuid1", "ConceptUuid2"); Date lastSyncTime = mock(Date.class); when(lastSy...
public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_OBSERV...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
@Test public void shouldUpdateLastSyncTimeForObservation() throws Exception, ObservationController.DownloadObservationException { List<String> patientUuids = asList("PatientUuid1", "PatientUuid2"); List<String> conceptUuids = asList("ConceptUuid1", "ConceptUuid2"); Date currentDate = mock(Date.class); when(sntpService....
public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_OBSERV...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
@Test public void shouldProperlyProcessChangeInKnownPatientOrConcept() throws ObservationController.DownloadObservationException, IOException { List<String> patientUuids = asList("PatientUuid1", "PatientUuid2"); List<String> conceptUuids = asList("ConceptUuid1", "ConceptUuid2"); List<String> previousPatientUuids = asLi...
public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_OBSERV...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
@Test public void shouldRecognisedNonInitialisedLastSyncTime() throws ObservationController.DownloadObservationException, IOException { List<String> patientUuids = asList("PatientUuid1", "PatientUuid2"); List<String> conceptUuids = asList("ConceptUuid1", "ConceptUuid2"); when(lastSyncTimeService.getLastSyncTimeFor(DOWN...
public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_OBSERV...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
ObservationController { public List<Observation> downloadObservationsByPatientUuidsAndConceptUuids(List<String> patientUuids, List<String> conceptUuids) throws DownloadObservationException { try { String paramSignature = buildParamSignature(patientUuids, conceptUuids); Date lastSyncTime = lastSyncTimeService.getLastSyn...
@Test public void authenticate_shouldCallCloseSessionIfExceptionOccurred() throws Exception { String[] credentials = new String[]{"username", "password", "url"}; doThrow(new ParseException()).when(muzimaContext).authenticate(credentials[0], credentials[1], credentials[2], false); muzimaSyncService.authenticate(credenti...
public int authenticate(String[] credentials) { return authenticate(credentials, false); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
@Test public void saveObservations_shouldSaveObservationsForPatient() throws Exception, ObservationController.SaveObservationException { final Concept concept1 = new Concept() {{ setUuid("concept1"); }}; final Concept concept2 = new Concept() {{ setUuid("concept2"); }}; final List<Observation> observations = buildObser...
public void saveObservations(List<Observation> observations) throws SaveObservationException { try { observationService.saveObservations(observations); } catch (IOException e) { throw new SaveObservationException(e); } }
ObservationController { public void saveObservations(List<Observation> observations) throws SaveObservationException { try { observationService.saveObservations(observations); } catch (IOException e) { throw new SaveObservationException(e); } } }
ObservationController { public void saveObservations(List<Observation> observations) throws SaveObservationException { try { observationService.saveObservations(observations); } catch (IOException e) { throw new SaveObservationException(e); } } ObservationController(ObservationService observationService, ConceptService...
ObservationController { public void saveObservations(List<Observation> observations) throws SaveObservationException { try { observationService.saveObservations(observations); } catch (IOException e) { throw new SaveObservationException(e); } } ObservationController(ObservationService observationService, ConceptService...
ObservationController { public void saveObservations(List<Observation> observations) throws SaveObservationException { try { observationService.saveObservations(observations); } catch (IOException e) { throw new SaveObservationException(e); } } ObservationController(ObservationService observationService, ConceptService...
@Test public void getAllCohorts_shouldReturnAllAvailableCohorts() throws IOException, CohortController.CohortFetchException { List<Cohort> cohorts = new ArrayList<>(); when(cohortService.getAllCohorts()).thenReturn(cohorts); assertThat(controller.getAllCohorts(), is(cohorts)); }
public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } }
CohortController { public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } }
CohortController { public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplicat...
CohortController { public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplicat...
CohortController { public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplicat...
@Test(expected = CohortController.CohortFetchException.class) public void getAllCohorts_shouldThrowCohortFetchExceptionIfExceptionThrownByCohortService() throws IOException, CohortController.CohortFetchException { doThrow(new IOException()).when(cohortService).getAllCohorts(); controller.getAllCohorts(); doThrow(new Pa...
public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } }
CohortController { public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } }
CohortController { public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplicat...
CohortController { public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplicat...
CohortController { public List<Cohort> getAllCohorts() throws CohortFetchException { try { return cohortService.getAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplicat...
@Test public void downloadAllCohorts_shouldReturnDownloadedCohorts() throws CohortController.CohortDownloadException, IOException { List<Cohort> downloadedCohorts = new ArrayList<>(); List<Cohort> cohorts = new ArrayList<>(); when(cohortService.downloadCohortsByName(StringUtils.EMPTY,null, null)).thenReturn(downloadedC...
public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNameAndSyncDate(String...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
@Test(expected = CohortController.CohortDownloadException.class) public void downloadAllCohorts_shouldThrowCohortDownloadExceptionIfExceptionIsThrownByCohortService() throws CohortController.CohortDownloadException, IOException { doThrow(new IOException()).when(cohortService).downloadCohortsByNameAndSyncDate(StringUtil...
public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNameAndSyncDate(String...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
@Test public void shouldSaveLastSyncTimeAfterDownloadingAllCohorts() throws Exception, CohortController.CohortDownloadException { ArgumentCaptor<LastSyncTime> lastSyncCaptor = ArgumentCaptor.forClass(LastSyncTime.class); when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS)).thenReturn(anotherMockDate); when(sn...
public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNameAndSyncDate(String...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
CohortController { public List<Cohort> downloadAllCohorts(String defaultLocation) throws CohortDownloadException { try { Date lastSyncTimeForCohorts = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS); Provider loggedInProvider = getLoggedInProvider(); List<Cohort> allCohorts = cohortService.downloadCohortsByNam...
@Test public void shouldSaveLastSyncTimeAfterDownloadingAllCohortsWithPrefix() throws Exception, CohortController.CohortDownloadException { ArgumentCaptor<LastSyncTime> lastSyncCaptor = ArgumentCaptor.forClass(LastSyncTime.class); when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS, "prefix1")).thenReturn(anot...
public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String cohortPrefix : coh...
CohortController { public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String...
CohortController { public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String...
CohortController { public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String...
CohortController { public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String...
@Test public void downloadCohortDataByUuid_shouldDownloadCohortByUuid() throws IOException, CohortController.CohortDownloadException { CohortData cohortData = new CohortData(); String uuid = "uuid"; when(cohortService.downloadCohortDataAndSyncDate(uuid, false, null, null, null)).thenReturn(cohortData); when(lastSyncTim...
public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downloadCohortDataAndSyn...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
@Test public void shouldSaveLastSyncTimeOfCohortData() throws Exception, CohortController.CohortDownloadException { String uuid = "uuid"; when(lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid)).thenReturn(mockDate); when(sntpService.getTimePerDeviceTimeZone()).thenReturn(anotherMockDate); controller.d...
public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downloadCohortDataAndSyn...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
@Test(expected = CohortController.CohortDownloadException.class) public void downloadCohortDataByUuid_shouldThrowCohortDownloadExceptionIfExceptionThrownByCohortService() throws IOException, CohortController.CohortDownloadException { String uuid = "uuid"; doThrow(new IOException()).when(cohortService).downloadCohortDat...
public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downloadCohortDataAndSyn...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
CohortController { public CohortData downloadCohortDataByUuid(String uuid,String defaultLocation) throws CohortDownloadException { try { Date lastSyncDate = lastSyncTimeService.getLastSyncTimeFor(DOWNLOAD_COHORTS_DATA, uuid); Provider loggedInProvider = getLoggedInProvider(); CohortData cohortData = cohortService.downl...
@Test public void authenticate_shouldReturnParsingErrorIfParsingExceptionOccurs() throws Exception { String[] credentials = new String[]{"username", "password", "url"}; doThrow(new ParseException()).when(muzimaContext).authenticate(credentials[0], credentials[1], credentials[2], false); assertThat(muzimaSyncService.aut...
public int authenticate(String[] credentials) { return authenticate(credentials, false); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
@Test public void downloadCohortDataAndSyncDate_shouldDownloadDeltaCohortDataBySyncDate() throws IOException, CohortController.CohortDownloadException, ProviderController.ProviderLoadException { String[] uuids = new String[]{"uuid1", "uuid2"}; CohortData cohortData1 = new CohortData(); CohortData cohortData2 = new Coho...
public List<CohortData> downloadCohortData(String[] cohortUuids, String defaulLocation) throws CohortDownloadException { ArrayList<CohortData> allCohortData = new ArrayList<>(); for (String cohortUuid : cohortUuids) { allCohortData.add(downloadCohortDataByUuid(cohortUuid, defaulLocation)); } return allCohortData; }
CohortController { public List<CohortData> downloadCohortData(String[] cohortUuids, String defaulLocation) throws CohortDownloadException { ArrayList<CohortData> allCohortData = new ArrayList<>(); for (String cohortUuid : cohortUuids) { allCohortData.add(downloadCohortDataByUuid(cohortUuid, defaulLocation)); } return a...
CohortController { public List<CohortData> downloadCohortData(String[] cohortUuids, String defaulLocation) throws CohortDownloadException { ArrayList<CohortData> allCohortData = new ArrayList<>(); for (String cohortUuid : cohortUuids) { allCohortData.add(downloadCohortDataByUuid(cohortUuid, defaulLocation)); } return a...
CohortController { public List<CohortData> downloadCohortData(String[] cohortUuids, String defaulLocation) throws CohortDownloadException { ArrayList<CohortData> allCohortData = new ArrayList<>(); for (String cohortUuid : cohortUuids) { allCohortData.add(downloadCohortDataByUuid(cohortUuid, defaulLocation)); } return a...
CohortController { public List<CohortData> downloadCohortData(String[] cohortUuids, String defaulLocation) throws CohortDownloadException { ArrayList<CohortData> allCohortData = new ArrayList<>(); for (String cohortUuid : cohortUuids) { allCohortData.add(downloadCohortDataByUuid(cohortUuid, defaulLocation)); } return a...
@Test public void downloadCohortsByPrefix_shouldDownloadAllCohortsForTheGivenPrefixes() throws IOException, CohortController.CohortDownloadException { List<String> cohortPrefixes = new ArrayList<String>() {{ add("Age"); add("age"); add("Encounter"); }}; Cohort cohort11 = new Cohort() {{ setUuid("uuid1"); setName("Age b...
public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String cohortPrefix : coh...
CohortController { public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String...
CohortController { public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String...
CohortController { public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String...
CohortController { public List<Cohort> downloadCohortsByPrefix(List<String> cohortPrefixes,String defaultLocation) throws CohortDownloadException { Provider loggedInProvider = getLoggedInProvider(); List<Cohort> filteredCohorts = new ArrayList<>(); try { Date lastSyncDateOfCohort; LastSyncTime lastSyncTime; for (String...
@Test public void saveAllCohorts_shouldSaveAllCohorts() throws CohortController.CohortSaveException, IOException { ArrayList<Cohort> cohorts = new ArrayList<Cohort>() {{ add(new Cohort()); add(new Cohort()); add(new Cohort()); }}; controller.saveAllCohorts(cohorts); verify(cohortService).saveCohorts(cohorts); verifyNoM...
public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } }
CohortController { public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } } }
CohortController { public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, Muzim...
CohortController { public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, Muzim...
CohortController { public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, Muzim...
@Test(expected = CohortController.CohortSaveException.class) public void saveAllCohorts_shouldThrowCohortSaveExceptionIfExceptionThrownByCohortService() throws IOException, CohortController.CohortSaveException { ArrayList<Cohort> cohorts = new ArrayList<Cohort>() {{ add(new Cohort()); }}; doThrow(new IOException()).whe...
public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } }
CohortController { public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } } }
CohortController { public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, Muzim...
CohortController { public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, Muzim...
CohortController { public void saveAllCohorts(List<Cohort> cohorts) throws CohortSaveException { try { cohortService.saveCohorts(cohorts); } catch (IOException e) { throw new CohortSaveException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, Muzim...
@Test public void getTotalCohortsCount_shouldReturnEmptyListOfNoCohortsHaveBeenSynced() throws IOException, CohortController.CohortFetchException { when(cohortService.countAllCohorts()).thenReturn(2); assertThat(controller.countAllCohorts(), is(2)); }
public int countAllCohorts() throws CohortFetchException { try { return cohortService.countAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } }
CohortController { public int countAllCohorts() throws CohortFetchException { try { return cohortService.countAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } }
CohortController { public int countAllCohorts() throws CohortFetchException { try { return cohortService.countAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplication m...
CohortController { public int countAllCohorts() throws CohortFetchException { try { return cohortService.countAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplication m...
CohortController { public int countAllCohorts() throws CohortFetchException { try { return cohortService.countAllCohorts(); } catch (IOException e) { throw new CohortFetchException(e); } } CohortController(CohortService cohortService, LastSyncTimeService lastSyncTimeService, SntpService sntpService, MuzimaApplication m...
@Test public void shouldShowProgressDialogWithGivenText() { dialog.show("title"); Mockito.verify(progressDialog).setCancelable(false); Mockito.verify(progressDialog).setTitle("title"); Mockito.verify(progressDialog).setMessage("This might take a while"); Mockito.verify(progressDialog).show(); }
@JavascriptInterface public void show(String title) { dialog.setTitle(title); dialog.setMessage(dialog.getContext().getResources().getString(R.string.general_progress_message)); dialog.show(); }
MuzimaProgressDialog { @JavascriptInterface public void show(String title) { dialog.setTitle(title); dialog.setMessage(dialog.getContext().getResources().getString(R.string.general_progress_message)); dialog.show(); } }
MuzimaProgressDialog { @JavascriptInterface public void show(String title) { dialog.setTitle(title); dialog.setMessage(dialog.getContext().getResources().getString(R.string.general_progress_message)); dialog.show(); } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); }
MuzimaProgressDialog { @JavascriptInterface public void show(String title) { dialog.setTitle(title); dialog.setMessage(dialog.getContext().getResources().getString(R.string.general_progress_message)); dialog.show(); } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); @JavascriptInt...
MuzimaProgressDialog { @JavascriptInterface public void show(String title) { dialog.setTitle(title); dialog.setMessage(dialog.getContext().getResources().getString(R.string.general_progress_message)); dialog.show(); } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); @JavascriptInt...
@Test public void shouldDismissADialogOnlyWhenVisible() { when(progressDialog.isShowing()).thenReturn(true); dialog.dismiss(); Mockito.verify(progressDialog).dismiss(); }
@JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } }
MuzimaProgressDialog { @JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } } }
MuzimaProgressDialog { @JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); }
MuzimaProgressDialog { @JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); @JavascriptInterface void show(String title); @JavascriptInterface void updateMessage(String message); @JavascriptIn...
MuzimaProgressDialog { @JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); @JavascriptInterface void show(String title); @JavascriptInterface void updateMessage(String message); @JavascriptIn...
@Test public void shouldNotCallDismissIfProgressBarISNotVisible() { when(progressDialog.isShowing()).thenReturn(false); dialog.dismiss(); Mockito.verify(progressDialog, Mockito.never()).dismiss(); }
@JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } }
MuzimaProgressDialog { @JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } } }
MuzimaProgressDialog { @JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); }
MuzimaProgressDialog { @JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); @JavascriptInterface void show(String title); @JavascriptInterface void updateMessage(String message); @JavascriptIn...
MuzimaProgressDialog { @JavascriptInterface public void dismiss() { if (dialog.isShowing()) { dialog.dismiss(); } } MuzimaProgressDialog(Activity activity); MuzimaProgressDialog(ProgressDialog dialog); @JavascriptInterface void show(String title); @JavascriptInterface void updateMessage(String message); @JavascriptIn...
@Test public void shouldNotParseIncompletedForm() throws SetupConfigurationController.SetupConfigurationFetchException { when(formWebViewActivity.getString(anyInt())).thenReturn("success"); SetupConfigurationTemplate setupConfigurationTemplate = new SetupConfigurationTemplate(); setupConfigurationTemplate.setUuid("dumm...
@JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); }
HTMLFormDataStore { @JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); } }
HTMLFormDataStore { @JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); } HTMLFormDataStore(HTMLFormWebViewActivity formWebViewActivity, FormData formData, boolean isFormReload, MuzimaApplication application); }
HTMLFormDataStore { @JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); } HTMLFormDataStore(HTMLFormWebViewActivity formWebViewActivity, FormData formData, boolean isFormReload, MuzimaApplication application); @JavascriptInterface String getStatus(); @Jav...
HTMLFormDataStore { @JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); } HTMLFormDataStore(HTMLFormWebViewActivity formWebViewActivity, FormData formData, boolean isFormReload, MuzimaApplication application); @JavascriptInterface String getStatus(); @Jav...
@Test public void save_shouldSaveFormDataWithStatus() throws FormController.FormDataSaveException { store.save("data", "xmldata", "status"); verify(controller).saveFormData(formData); verify(activity).finish(); assertThat(formData.getJsonPayload(), is("data")); assertThat(formData.getStatus(), is("status")); }
@JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,formData); formData....
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
@Test public void authenticate_shouldReturnConnectionErrorIfConnectionErrorOccurs() throws Exception { String[] credentials = new String[]{"username", "password", "url"}; doThrow(new ConnectException()).when(muzimaContext).authenticate(credentials[0], credentials[1], credentials[2], false); assertThat(muzimaSyncService...
public int authenticate(String[] credentials) { return authenticate(credentials, false); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
@Test public void save_shouldNotFinishTheActivityIfThereIsAnExceptionWhileSaving() throws FormController.FormDataSaveException { doThrow(new FormController.FormDataSaveException(null)).when(controller).saveFormData(formData); when(activity.getString(anyInt())).thenReturn("success"); store.save("data", "xmldata", "statu...
@JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,formData); formData....
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
@Test public void getFormPayload_shouldGetTheFormDataPayload() { formData.setJsonPayload("payload"); assertThat(store.getFormPayload(), is("payload")); }
@JavascriptInterface public String getFormPayload() { return formData.getJsonPayload(); }
FormDataStore { @JavascriptInterface public String getFormPayload() { return formData.getJsonPayload(); } }
FormDataStore { @JavascriptInterface public String getFormPayload() { return formData.getJsonPayload(); } FormDataStore(FormWebViewActivity formWebViewActivity, FormController formController, FormData formData); }
FormDataStore { @JavascriptInterface public String getFormPayload() { return formData.getJsonPayload(); } FormDataStore(FormWebViewActivity formWebViewActivity, FormController formController, FormData formData); @JavascriptInterface void save(String jsonData, String xmlData, String status); @JavascriptInterface String ...
FormDataStore { @JavascriptInterface public String getFormPayload() { return formData.getJsonPayload(); } FormDataStore(FormWebViewActivity formWebViewActivity, FormController formController, FormData formData); @JavascriptInterface void save(String jsonData, String xmlData, String status); @JavascriptInterface String ...
@Test public void shouldCreateANewPatientAndStoreHisUUIDAsPatientUUID() { String tempUUIDAssignedByDevice = "newUUID"; formData.setPatientUuid(null); formData.setDiscriminator(FORM_DISCRIMINATOR_REGISTRATION); Patient patient = new Patient(); patient.setUuid(tempUUIDAssignedByDevice); when(controller.createNewPatient(m...
@JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,formData); formData....
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
@Test public void shouldParseObservationsInProvidedPayloadWhenSavingAsFinal() throws ConceptController.ConceptSaveException, ParseException, XmlPullParserException, PatientController.PatientLoadException,ConceptController.ConceptFetchException, ConceptController.ConceptParseException, IOException, ObservationController...
@JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,formData); formData....
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
@Test public void shouldNotParseObservationsForIncompleteForm() throws ConceptController.ConceptSaveException, ParseException, XmlPullParserException, PatientController.PatientLoadException, ConceptController.ConceptFetchException, ConceptController.ConceptParseException, ObservationController.ParseObservationException...
@JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,formData); formData....
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
FormDataStore { @JavascriptInterface public void save(String jsonData, String xmlData, String status) { formData.setXmlPayload(xmlData); formData.setJsonPayload(jsonData); formData.setStatus(status); try { if (isRegistrationComplete(status)) { Patient newPatient = formController.createNewPatient(applicationContext,form...
@Test public void shouldAddPatientDetailsOnJSONFromPatient() { Date birthdate = new Date(); SimpleDateFormat formattedDate = new SimpleDateFormat(STANDARD_DATE_FORMAT); Patient patient = patient(new Date()); HTMLPatientJSONMapper mapper = new HTMLPatientJSONMapper(); FormData formData = new FormData(); User user = new ...
public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medical_record_number", Strin...
HTMLPatientJSONMapper { public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medic...
HTMLPatientJSONMapper { public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medic...
HTMLPatientJSONMapper { public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medic...
HTMLPatientJSONMapper { public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medic...
@Test public void shouldNotFailIFBirthDateIsNull() { Patient patient = patient(null); HTMLPatientJSONMapper htmlPatientJSONMapper = new HTMLPatientJSONMapper(); User user = new User(); String json = htmlPatientJSONMapper.map(patient, new FormData(), user, false); assertThat(json,not(containsString("\"patient.birth_date...
public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medical_record_number", Strin...
HTMLPatientJSONMapper { public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medic...
HTMLPatientJSONMapper { public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medic...
HTMLPatientJSONMapper { public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medic...
HTMLPatientJSONMapper { public String map(Patient patient, FormData formData, User loggedInUser, boolean isLoggedInUserIsDefaultProvider) { JSONObject prepopulateJSON = new JSONObject(); JSONObject patientDetails = new JSONObject(); JSONObject encounterDetails = new JSONObject(); try { patientDetails.put("patient.medic...
@Test public void shouldReturnCommaSeparatedList(){ ArrayList<String> listOfStrings = new ArrayList<String>() {{ add("Patient"); add("Registration"); add("New Tag"); }}; String commaSeparatedValues = StringUtils.getCommaSeparatedStringFromList(listOfStrings); assertThat(commaSeparatedValues, is("Patient,Registration,Ne...
public static String getCommaSeparatedStringFromList(final List<String> values){ if(values == null){ return ""; } StringBuilder builder = new StringBuilder(); for (String next : values) { builder.append(next).append(","); } String commaSeparated = builder.toString(); return commaSeparated.substring(0, commaSeparated.le...
StringUtils { public static String getCommaSeparatedStringFromList(final List<String> values){ if(values == null){ return ""; } StringBuilder builder = new StringBuilder(); for (String next : values) { builder.append(next).append(","); } String commaSeparated = builder.toString(); return commaSeparated.substring(0, com...
StringUtils { public static String getCommaSeparatedStringFromList(final List<String> values){ if(values == null){ return ""; } StringBuilder builder = new StringBuilder(); for (String next : values) { builder.append(next).append(","); } String commaSeparated = builder.toString(); return commaSeparated.substring(0, com...
StringUtils { public static String getCommaSeparatedStringFromList(final List<String> values){ if(values == null){ return ""; } StringBuilder builder = new StringBuilder(); for (String next : values) { builder.append(next).append(","); } String commaSeparated = builder.toString(); return commaSeparated.substring(0, com...
StringUtils { public static String getCommaSeparatedStringFromList(final List<String> values){ if(values == null){ return ""; } StringBuilder builder = new StringBuilder(); for (String next : values) { builder.append(next).append(","); } String commaSeparated = builder.toString(); return commaSeparated.substring(0, com...
@Test public void shouldSortByFamilyName() { Patient obama = patient("Obama", "Barack", "Hussein", "id1"); Patient bush = patient("Bush", "George", "W", "id2"); assertTrue(patientComparator.compare(obama, bush) > 0); }
@Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFamilyName()); if (familyNameCompareResult != 0) { re...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
@Test public void shouldSortByGivenNameIfFamilyNameIsSame() { Patient barack = patient("Obama", "Barack", "Hussein", "id1"); Patient george = patient("Obama", "George", "W", "id2"); assertTrue(patientComparator.compare(barack, george) < 0); }
@Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFamilyName()); if (familyNameCompareResult != 0) { re...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
@Test public void authenticate_shouldReturnAuthenticationErrorIfAuthenticationErrorOccurs() throws Exception { String[] credentials = new String[]{"username", "password", "url"}; doThrow(new IOException()).when(muzimaContext).authenticate(credentials[0], credentials[1], credentials[2], false); assertThat(muzimaSyncServ...
public int authenticate(String[] credentials) { return authenticate(credentials, false); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); }
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
MuzimaSyncService { public int authenticate(String[] credentials) { return authenticate(credentials, false); } MuzimaSyncService(MuzimaApplication muzimaContext); int authenticate(String[] credentials); int authenticate(String[] credentials, boolean isUpdatePasswordRequired); int[] downloadForms(); int[] downloadFormTe...
@Test public void shouldSortByMiddleNameIfGivenNameAndFamilyNameAreSame() { Patient hussein = patient("Obama", "Barack", "Hussein", "id1"); Patient william = patient("Obama", "Barack", "William", "id2"); assertTrue(patientComparator.compare(hussein, william) < 0); }
@Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFamilyName()); if (familyNameCompareResult != 0) { re...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
PatientComparator implements Comparator<Patient> { @Override public int compare(Patient patient1, Patient patient2) { if (patient1 == null) { patient1 = new Patient(); } if (patient2 == null) { patient2 = new Patient(); } int familyNameCompareResult = StringUtils.nullSafeCompare(patient1.getFamilyName(), patient2.getFa...
@Test public void downloadForms_shouldReplaceOldForms() throws FormController.FormFetchException, FormController.FormSaveException { List<Form> forms = new ArrayList<>(); when(formController.downloadAllForms()).thenReturn(forms); muzimaSyncService.downloadForms(); verify(formController).downloadAllForms(); verify(formC...
public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownloadedForms, allForms); ...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
@Test public void downloadForms_shouldReturnSuccessStatusAndDownloadCountIfSuccessful() throws FormController.FormFetchException { int[] result = new int[]{SyncStatusConstants.SUCCESS, 2, 0}; List<Form> forms = new ArrayList<Form>() {{ add(new Form()); add(new Form()); }}; when(formController.downloadAllForms()).thenRe...
public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownloadedForms, allForms); ...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
@Test public void downloadForms_shouldReturnDeletedFormCount() throws FormController.FormFetchException { int[] result = new int[]{SyncStatusConstants.SUCCESS, 2, 1}; List<Form> downloadedForms = new ArrayList<>(); Form formToDelete = new Form(); formToDelete.setRetired(true); formToDelete.setUuid("123"); Form newForm ...
public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownloadedForms, allForms); ...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
@Test public void downloadForms_shouldReturnDownloadErrorIfDownloadExceptionOccur() throws FormController.FormFetchException { doThrow(new FormController.FormFetchException(null)).when(formController).downloadAllForms(); assertThat(muzimaSyncService.downloadForms()[0], is(SyncStatusConstants.DOWNLOAD_ERROR)); }
public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownloadedForms, allForms); ...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
@Test public void downloadForms_shouldReturnSaveErrorIfSaveExceptionOccur() throws FormController.FormSaveException { doThrow(new FormController.FormSaveException(null)).when(formController).updateAllForms(anyList()); assertThat(muzimaSyncService.downloadForms()[0], is(SyncStatusConstants.SAVE_ERROR)); }
public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownloadedForms, allForms); ...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
MuzimaSyncService { public int[] downloadForms() { int[] result = new int[3]; try { long startDownloadForms = System.currentTimeMillis(); List<Form> allDownloadedForms = formController.downloadAllForms(); List<Form> allForms = formController.getAllAvailableForms(); int deletedFormCount = getDeletedFormCount(allDownload...
@Test public void shouldReturnTrueIfHasRegistrationDiscriminator() { AvailableForm availableForm = new AvailableForm(); for(String discriminator: registrationDiscriminators) { availableForm.setDiscriminator(discriminator); assertTrue(availableForm.isRegistrationForm()); } }
public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FO...
AvailableForm extends BaseForm { public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(ge...
AvailableForm extends BaseForm { public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(ge...
AvailableForm extends BaseForm { public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(ge...
AvailableForm extends BaseForm { public boolean isRegistrationForm(){ return Constants.FORM_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_REGISTRATION.equalsIgnoreCase(getDiscriminator()) || Constants.FORM_JSON_DISCRIMINATOR_GENERIC_REGISTRATION.equalsIgnoreCase(ge...
@Test public void downloadFormTemplates_shouldReplaceDownloadedTemplates() throws FormController.FormFetchException, FormController.FormSaveException { String[] formTemplateUuids = new String[]{}; List<FormTemplate> formTemplates = new ArrayList<>(); when(formController.downloadFormTemplates(formTemplateUuids)).thenRet...
public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemplates.size() + " for...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
@Test public void downloadFormTemplates_shouldReturnSuccessStatusAndDownloadCountIfSuccessful() throws FormController.FormFetchException { int[] result = new int[]{SyncStatusConstants.SUCCESS, 2, 0, 0}; List<FormTemplate> formTemplates = new ArrayList<FormTemplate>() {{ FormTemplate formTemplate = new FormTemplate(); f...
public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemplates.size() + " for...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
@Test public void downloadFormTemplates_shouldReturnDownloadErrorIfDownloadExceptionOccur() throws FormController.FormFetchException { String[] formUuids = {}; doThrow(new FormController.FormFetchException(null)).when(formController).downloadFormTemplates(formUuids); assertThat(muzimaSyncService.downloadFormTemplates(f...
public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemplates.size() + " for...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
@Test public void downloadFormTemplates_shouldReturnSaveErrorIfSaveExceptionOccur() throws FormController.FormSaveException { String[] formUuids = {}; doThrow(new FormController.FormSaveException(null)).when(formController).replaceFormTemplates(anyList()); assertThat(muzimaSyncService.downloadFormTemplates(formUuids,tr...
public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemplates.size() + " for...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
MuzimaSyncService { public int[] downloadFormTemplates(String[] formIds, boolean replaceExistingTemplates) { int[] result = new int[4]; try { List<FormTemplate> formTemplates = formController.downloadFormTemplates(formIds); formTemplates.removeAll(Collections.singleton(null)); Log.i(getClass().getSimpleName(), formTemp...
@Test public void downloadCohort_shouldDownloadAllCohortsWhenNoPrefixesAreAvailableAndReplaceOldCohorts() throws CohortController.CohortDownloadException, CohortController.CohortDeleteException, CohortController.CohortSaveException { List<Cohort> cohorts = new ArrayList<>(); when(cohortController.downloadAllCohorts(nul...
public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts are saved"); result[0...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
@Test public void shouldDeleteVoidedCohortsWhenDownloading() throws CohortController.CohortDownloadException, CohortController.CohortSaveException, CohortController.CohortDeleteException { List<Cohort> cohorts = new ArrayList<>(); Cohort aCohort = mock(Cohort.class); Cohort voidedCohort = mock(Cohort.class); when(voide...
public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts are saved"); result[0...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
@Test public void downloadCohort_shouldDownloadOnlyPrefixedCohortsWhenPrefixesAreAvailableAndReplaceOldCohorts() throws CohortController.CohortDownloadException, CohortController.CohortDeleteException, CohortController.CohortSaveException { List<Cohort> cohorts = new ArrayList<>(); List<String> cohortPrefixes = new Arr...
public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts are saved"); result[0...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
@Test public void downloadCohort_shouldReturnSuccessStatusAndDownloadCountIfSuccessful() throws CohortController.CohortDownloadException { List<Cohort> cohorts = new ArrayList<Cohort>() {{ add(new Cohort()); add(new Cohort()); }}; int[] result = new int[]{SyncStatusConstants.SUCCESS, 2, 0}; when(muzimaApplication.getSh...
public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts are saved"); result[0...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
@Test public void downloadCohort_shouldReturnDownloadErrorIfDownloadExceptionOccurs() throws CohortController.CohortDownloadException { when(muzimaApplication.getSharedPreferences(COHORT_PREFIX_PREF, android.content.Context.MODE_PRIVATE)).thenReturn(sharedPref); when(sharedPref.getStringSet(Constants.COHORT_PREFIX_PREF...
public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts are saved"); result[0...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
@Test public void downloadCohort_shouldReturnSaveErrorIfSaveExceptionOccurs() throws CohortController.CohortSaveException { when(muzimaApplication.getSharedPreferences(COHORT_PREFIX_PREF, android.content.Context.MODE_PRIVATE)).thenReturn(sharedPref); when(sharedPref.getStringSet(Constants.COHORT_PREFIX_PREF_KEY, new Ha...
public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts are saved"); result[0...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
MuzimaSyncService { public int[] downloadCohorts() { int[] result = new int[3]; try { List<Cohort> cohorts = downloadCohortsList(); List<Cohort> voidedCohorts = deleteVoidedCohorts(cohorts); cohorts.removeAll(voidedCohorts); cohortController.saveOrUpdateCohorts(cohorts); Log.i(getClass().getSimpleName(), "New cohorts a...
@Test public void shouldSortTheConceptsByDate() { final Observation observation1 = createObservation(createConcept("c1"), "01", new Date(1)); final Observation observation2 = createObservation(createConcept("c2"), "02", new Date(3)); final Observation observation3 = createObservation(createConcept("c1"), "03", new Date...
public void sortByDate() { Collections.sort(this, new Comparator<ConceptWithObservations>() { @Override public int compare(ConceptWithObservations lhs, ConceptWithObservations rhs) { return -(lhs.getObservations().get(0).getObservationDatetime() .compareTo(rhs.getObservations().get(0).getObservationDatetime())); } }); ...
Concepts extends ArrayList<ConceptWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<ConceptWithObservations>() { @Override public int compare(ConceptWithObservations lhs, ConceptWithObservations rhs) { return -(lhs.getObservations().get(0).getObservationDatetime() .compareTo(rhs.getOb...
Concepts extends ArrayList<ConceptWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<ConceptWithObservations>() { @Override public int compare(ConceptWithObservations lhs, ConceptWithObservations rhs) { return -(lhs.getObservations().get(0).getObservationDatetime() .compareTo(rhs.getOb...
Concepts extends ArrayList<ConceptWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<ConceptWithObservations>() { @Override public int compare(ConceptWithObservations lhs, ConceptWithObservations rhs) { return -(lhs.getObservations().get(0).getObservationDatetime() .compareTo(rhs.getOb...
Concepts extends ArrayList<ConceptWithObservations> { public void sortByDate() { Collections.sort(this, new Comparator<ConceptWithObservations>() { @Override public int compare(ConceptWithObservations lhs, ConceptWithObservations rhs) { return -(lhs.getObservations().get(0).getObservationDatetime() .compareTo(rhs.getOb...
@Test public void downloadPatientsForCohorts_shouldDownloadAndReplaceCohortMembersAndPatients() throws CohortController.CohortDownloadException, CohortController.CohortReplaceException, PatientController.PatientSaveException, CohortController.CohortUpdateException, ProviderController.ProviderLoadException { String[] co...
public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownloadCohortData = System....
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
@Test public void shouldDeleteVoidedPatientsDuringPatientDownload() throws CohortController.CohortDownloadException, PatientController.PatientDeleteException, ProviderController.ProviderLoadException { String[] cohortUuids = new String[]{"uuid1", "uuid2"}; final Patient voidedPatient = mock(Patient.class); when(voidedP...
public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownloadCohortData = System....
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
@Test public void downloadPatientsForCohorts_shouldReturnSuccessStatusAndCohortAndPatinetCountIfDownloadIsSuccessful() throws CohortController.CohortDownloadException { String[] cohortUuids = new String[]{"uuid1", "uuid2"}; List<CohortData> cohortDataList = new ArrayList<CohortData>() {{ add(new CohortData() {{ addCoho...
public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownloadCohortData = System....
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
@Test public void downloadPatientsForCohorts_shouldReturnDownloadErrorIfDownloadExceptionIsThrown() throws CohortController.CohortDownloadException, ProviderController.ProviderLoadException { String[] cohortUuids = new String[]{"uuid1", "uuid2"}; doThrow(new CohortController.CohortDownloadException(null)).when(cohortCo...
public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownloadCohortData = System....
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
@Test public void downloadPatientsForCohorts_shouldReturnReplaceErrorIfReplaceExceptionIsThrownForCohorts() throws CohortController.CohortReplaceException, CohortController.CohortDownloadException, ProviderController.ProviderLoadException { String[] cohortUuids = new String[]{"uuid1", "uuid2"}; List<CohortData> cohortD...
public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownloadCohortData = System....
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
@Test public void downloadPatientsForCohorts_shouldReturnReplaceErrorIfReplaceExceptionIsThrownForPatients() throws CohortController.CohortDownloadException, PatientController.PatientSaveException, ProviderController.ProviderLoadException { String[] cohortUuids = new String[]{"uuid1", "uuid2"}; List<CohortData> cohortD...
public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownloadCohortData = System....
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
MuzimaSyncService { public int[] downloadPatientsForCohorts(String[] cohortUuids) { int[] result = new int[4]; int patientCount = 0; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadCohortData(cohortUuids, getDefaultLocation()); long endDownload...
@Test public void downloadObservationsForPatients_shouldDownloadObservationsForGiveCohortIdsAndSavedConcepts() throws PatientController.PatientLoadException, ObservationController.DownloadObservationException, ObservationController.ReplaceObservationException, ConceptController.ConceptFetchException, ObservationControl...
public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient patient : patients) { p...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...
MuzimaSyncService { public int[] downloadObservationsForPatientsByCohortUUIDs(String[] cohortUuids, boolean replaceExistingObservation) { int[] result = new int[4]; List<Patient> patients; try { patients = patientController.getPatientsForCohorts(cohortUuids); List<String> patientlist = new ArrayList(); for (Patient pat...