• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

opensrp / opensrp-client-core / #179

pending completion
#179

push

github-actions

web-flow
Merge pull request #922 from opensrp/change-sync-service-modifier

Update doSync method access

18308 of 26768 relevant lines covered (68.4%)

0.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.59
opensrp-core/src/main/java/org/smartregister/sync/intent/DocumentConfigurationIntentService.java
1
package org.smartregister.sync.intent;
2

3
import android.content.Intent;
4

5
import androidx.annotation.VisibleForTesting;
6

7
import org.jetbrains.annotations.NotNull;
8
import org.smartregister.CoreLibrary;
9
import org.smartregister.DristhiConfiguration;
10
import org.smartregister.repository.ClientFormRepository;
11
import org.smartregister.repository.ManifestRepository;
12
import org.smartregister.service.DocumentConfigurationService;
13
import org.smartregister.service.HTTPAgent;
14

15
import timber.log.Timber;
16

17
/**
18
 * Created by cozej4 on 2020-04-08.
19
 *
20
 * @author cozej4 https://github.com/cozej4
21
 */
22
public class DocumentConfigurationIntentService extends BaseSyncIntentService {
23
    private HTTPAgent httpAgent;
24
    private ManifestRepository manifestRepository;
25
    private ClientFormRepository clientFormRepository;
26
    private DristhiConfiguration configuration;
27

28
    public DocumentConfigurationIntentService() {
29
        super("DocumentConfigurationIntentService");
1✔
30
    }
1✔
31

32
    public DocumentConfigurationIntentService(String name) {
33
        super(name);
×
34
    }
×
35

36
    @Override
37
    public int onStartCommand(Intent intent, int flags, int startId) {
38
        httpAgent = CoreLibrary.getInstance().context().getHttpAgent();
1✔
39
        manifestRepository = CoreLibrary.getInstance().context().getManifestRepository();
1✔
40
        clientFormRepository = CoreLibrary.getInstance().context().getClientFormRepository();
1✔
41
        configuration = CoreLibrary.getInstance().context().configuration();
1✔
42
        return super.onStartCommand(intent, flags, startId);
1✔
43
    }
44

45
    @Override
46
    protected void onHandleIntent(Intent intent) {
47
        super.onHandleIntent(intent);
1✔
48

49
        try {
50
            DocumentConfigurationService documentConfigurationService = getDocumentConfigurationService();
1✔
51
            documentConfigurationService.fetchManifest();
1✔
52
        } catch (Exception e) {
×
53
            Timber.e(e);
×
54
        }
1✔
55
    }
1✔
56

57
    @VisibleForTesting
58
    @NotNull
59
    protected DocumentConfigurationService getDocumentConfigurationService() {
60
        return new DocumentConfigurationService(httpAgent, manifestRepository, clientFormRepository, configuration);
×
61
    }
62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc