method2testcases
stringlengths 118
6.63k
|
---|
### Question:
FileUtilities { public void write(String fileName, String data) { File root = Environment.getExternalStorageDirectory(); File outDir = new File(root.getAbsolutePath() + File.separator + "EZ_time_tracker"); if (!outDir.isDirectory()) { outDir.mkdir(); } try { if (!outDir.isDirectory()) { throw new IOException("Unable to create directory EZ_time_tracker. Maybe the SD " + "card is mounted?"); } File outputFile = new File(outDir, fileName); writer = new BufferedWriter(new FileWriter(outputFile)); writer.write(data); writer.close(); } catch (IOException e) { Timber.w(e); } } FileUtilities(); static Bitmap retrieveStaticImageFromDisk(String fileName); static String getFileExtension(String fileName); static String getUserAgent(Context mContext); static String getImageUrl(String entityID); void write(String fileName, String data); Writer getWriter(); String getAbsolutePath(); }### Answer:
@Test public void assertWriteWritesSuccessfully() throws Exception { String testData = "string to write"; when(Environment.getExternalStorageDirectory()).thenReturn(existentDirectory); PowerMockito.whenNew(BufferedWriter.class).withAnyArguments().thenReturn(mockWriter); FileUtilities fileUtils = new FileUtilities(); try { fileUtils.write(FILE_NAME, testData); String path = existentDirectory.getPath() + File.separator + "EZ_time_tracker" + File.separator + FILE_NAME; File file = new File(path); final String writenText = FileUtils.readFileToString(file); Assert.assertEquals(testData, writenText); } catch (Exception e) { Assert.fail(); } } |
### Question:
LocationServiceHelper extends BaseHelper { public void fetchOpenMrsLocationsByTeamIds() throws NoHttpResponseException, JSONException { HTTPAgent httpAgent = getHttpAgent(); if (httpAgent == null) { throw new IllegalArgumentException(OPENMRS_LOCATION_BY_TEAM_IDS + " http agent is null"); } String baseUrl = getFormattedBaseUrl(); Response resp = httpAgent.post( MessageFormat.format("{0}{1}", baseUrl, OPENMRS_LOCATION_BY_TEAM_IDS), new JSONArray().put(allSharedPreferences.fetchDefaultLocalityId( allSharedPreferences.fetchRegisteredANM())).toString()); if (resp.isFailure()) { throw new NoHttpResponseException(OPENMRS_LOCATION_BY_TEAM_IDS + " not returned data"); } Timber.i(resp.payload().toString()); JSONArray teamLocations = new JSONArray(resp.payload().toString()); for (int index = 0; index < teamLocations.length(); index++) { JSONObject openMrsLocation = teamLocations.getJSONObject(index); if (openMrsLocation.has(LOCATIONS) && openMrsLocation.has(TEAM)) { JSONArray actualLocations = openMrsLocation.getJSONArray(LOCATIONS); saveOpenMrsTeamLocation(openMrsLocation, actualLocations); } } } LocationServiceHelper(LocationRepository locationRepository, LocationTagRepository locationTagRepository, StructureRepository structureRepository); static LocationServiceHelper getInstance(); List<Location> fetchLocationsStructures(); void fetchLocationsByLevelAndTags(); SyncConfiguration getSyncConfiguration(); void syncCreatedStructureToServer(); void syncUpdatedLocationsToServer(); void fetchOpenMrsLocationsByTeamIds(); HTTPAgent getHttpAgent(); @NotNull String getFormattedBaseUrl(); void fetchAllLocations(); static final String LOCATION_STRUCTURE_URL; static final String CREATE_STRUCTURE_URL; static final String COMMON_LOCATIONS_SERVICE_URL; static final String OPENMRS_LOCATION_BY_TEAM_IDS; static final String STRUCTURES_LAST_SYNC_DATE; static final String LOCATION_LAST_SYNC_DATE; static Gson locationGson; }### Answer:
@Test public void fetchOpenMrsLocationsByTeamIds() throws JSONException, NoHttpResponseException { Mockito.doReturn(new Response<>(ResponseStatus.success, "[{\"locations\":[{\"display\":\"Tabata Dampo - Unified\",\"uuid\":\"fb7ed5db-138d-4e6f-94d8-bc443b58dadb\"}]," + "\"team\":{\"location\":{\"display\":\"Madona - Unified\",\"uuid\":\"bcf5a36d-fb53-4de9-9813-01f1d480e3fe\"}}}]")) .when(httpAgent).post(Mockito.anyString(), Mockito.anyString()); locationServiceHelper.fetchOpenMrsLocationsByTeamIds(); Mockito.verify(locationRepository, Mockito.atLeastOnce()).addOrUpdate(Mockito.any(Location.class)); Mockito.verify(locationTagRepository, Mockito.atLeastOnce()).addOrUpdate(Mockito.any(LocationTag.class)); }
@Test(expected = NoHttpResponseException.class) public void shouldThrowExceptionWhenThereIsFailureInResponse() throws JSONException, NoHttpResponseException { Mockito.doReturn(new Response<>(ResponseStatus.failure, "error")) .when(httpAgent).post(Mockito.anyString(), Mockito.anyString()); locationServiceHelper.fetchOpenMrsLocationsByTeamIds(); Mockito.verify(locationRepository, Mockito.atLeastOnce()).addOrUpdate(Mockito.any(Location.class)); Mockito.verify(locationTagRepository, Mockito.atLeastOnce()).addOrUpdate(Mockito.any(LocationTag.class)); } |
### Question:
LocationServiceHelper extends BaseHelper { public List<Location> fetchLocationsStructures() { syncLocationsStructures(true); List<Location> locations = syncLocationsStructures(false); syncCreatedStructureToServer(); syncUpdatedLocationsToServer(); return locations; } LocationServiceHelper(LocationRepository locationRepository, LocationTagRepository locationTagRepository, StructureRepository structureRepository); static LocationServiceHelper getInstance(); List<Location> fetchLocationsStructures(); void fetchLocationsByLevelAndTags(); SyncConfiguration getSyncConfiguration(); void syncCreatedStructureToServer(); void syncUpdatedLocationsToServer(); void fetchOpenMrsLocationsByTeamIds(); HTTPAgent getHttpAgent(); @NotNull String getFormattedBaseUrl(); void fetchAllLocations(); static final String LOCATION_STRUCTURE_URL; static final String CREATE_STRUCTURE_URL; static final String COMMON_LOCATIONS_SERVICE_URL; static final String OPENMRS_LOCATION_BY_TEAM_IDS; static final String STRUCTURES_LAST_SYNC_DATE; static final String LOCATION_LAST_SYNC_DATE; static Gson locationGson; }### Answer:
@Test public void testFetchLocationsStructures() { locationServiceHelper.fetchLocationsStructures(); verify(locationServiceHelper).syncLocationsStructures(true); verify(locationServiceHelper).syncLocationsStructures(false); verify(locationServiceHelper).syncCreatedStructureToServer(); verify(locationServiceHelper).syncCreatedStructureToServer(); } |
### Question:
LocationServiceHelper extends BaseHelper { public void syncCreatedStructureToServer() { List<Location> locations = structureRepository.getAllUnsynchedCreatedStructures(); if (!locations.isEmpty()) { String jsonPayload = locationGson.toJson(locations); String baseUrl = getFormattedBaseUrl(); Response<String> response = getHttpAgent().postWithJsonResponse( MessageFormat.format("{0}/{1}", baseUrl, CREATE_STRUCTURE_URL), jsonPayload); if (response.isFailure()) { Timber.e("Failed to create new locations on server: %s", response.payload()); return; } Set<String> unprocessedIds = new HashSet<>(); if (StringUtils.isNotBlank(response.payload())) { if (response.payload().startsWith(LOCATIONS_NOT_PROCESSED)) { unprocessedIds.addAll(Arrays.asList(response.payload().substring(LOCATIONS_NOT_PROCESSED.length()).split(","))); } for (Location location : locations) { if (!unprocessedIds.contains(location.getId())) structureRepository.markStructuresAsSynced(location.getId()); } } } } LocationServiceHelper(LocationRepository locationRepository, LocationTagRepository locationTagRepository, StructureRepository structureRepository); static LocationServiceHelper getInstance(); List<Location> fetchLocationsStructures(); void fetchLocationsByLevelAndTags(); SyncConfiguration getSyncConfiguration(); void syncCreatedStructureToServer(); void syncUpdatedLocationsToServer(); void fetchOpenMrsLocationsByTeamIds(); HTTPAgent getHttpAgent(); @NotNull String getFormattedBaseUrl(); void fetchAllLocations(); static final String LOCATION_STRUCTURE_URL; static final String CREATE_STRUCTURE_URL; static final String COMMON_LOCATIONS_SERVICE_URL; static final String OPENMRS_LOCATION_BY_TEAM_IDS; static final String STRUCTURES_LAST_SYNC_DATE; static final String LOCATION_LAST_SYNC_DATE; static Gson locationGson; }### Answer:
@Test public void testSyncCreatedStructureToServer() { Location expectedStructure = LocationServiceHelper.locationGson.fromJson(structureJSon, new TypeToken<Location>() { }.getType()); expectedStructure.setSyncStatus(BaseRepository.TYPE_Unsynced); List<Location> structures = Collections.singletonList(expectedStructure); when(structureRepository.getAllUnsynchedCreatedStructures()).thenReturn(structures); Mockito.doReturn("https: Mockito.doReturn(new Response<>(ResponseStatus.success, LocationServiceHelper.locationGson.toJson(structures))) .when(httpAgent).postWithJsonResponse(stringArgumentCaptor.capture(), stringArgumentCaptor.capture()); locationServiceHelper.syncCreatedStructureToServer(); String syncUrl = stringArgumentCaptor.getAllValues().get(0); assertEquals("https: String requestString = stringArgumentCaptor.getAllValues().get(1); assertEquals(LocationServiceHelper.locationGson.toJson(structures), requestString); verify(structureRepository).markStructuresAsSynced(expectedStructure.getId()); } |
### Question:
LocationServiceHelper extends BaseHelper { public void syncUpdatedLocationsToServer() { HTTPAgent httpAgent = getHttpAgent(); List<Location> locations = locationRepository.getAllUnsynchedLocation(); if (!locations.isEmpty()) { String jsonPayload = locationGson.toJson(locations); String baseUrl = getFormattedBaseUrl(); String isJurisdictionParam = "?" + IS_JURISDICTION + "=true"; Response<String> response = httpAgent.postWithJsonResponse( MessageFormat.format("{0}{1}{2}", baseUrl, CREATE_STRUCTURE_URL, isJurisdictionParam), jsonPayload); if (response.isFailure()) { Timber.e("Failed to create new locations on server: %s", response.payload()); return; } Set<String> unprocessedIds = new HashSet<>(); if (StringUtils.isNotBlank(response.payload())) { if (response.payload().startsWith(LOCATIONS_NOT_PROCESSED)) { unprocessedIds.addAll(Arrays.asList(response.payload().substring(LOCATIONS_NOT_PROCESSED.length()).split(","))); } for (Location location : locations) { if (!unprocessedIds.contains(location.getId())) locationRepository.markLocationsAsSynced(location.getId()); } } } } LocationServiceHelper(LocationRepository locationRepository, LocationTagRepository locationTagRepository, StructureRepository structureRepository); static LocationServiceHelper getInstance(); List<Location> fetchLocationsStructures(); void fetchLocationsByLevelAndTags(); SyncConfiguration getSyncConfiguration(); void syncCreatedStructureToServer(); void syncUpdatedLocationsToServer(); void fetchOpenMrsLocationsByTeamIds(); HTTPAgent getHttpAgent(); @NotNull String getFormattedBaseUrl(); void fetchAllLocations(); static final String LOCATION_STRUCTURE_URL; static final String CREATE_STRUCTURE_URL; static final String COMMON_LOCATIONS_SERVICE_URL; static final String OPENMRS_LOCATION_BY_TEAM_IDS; static final String STRUCTURES_LAST_SYNC_DATE; static final String LOCATION_LAST_SYNC_DATE; static Gson locationGson; }### Answer:
@Test public void testSyncUpdatedLocationsToServer() { Location expectedLocation = LocationServiceHelper.locationGson.fromJson(locationJSon, new TypeToken<Location>() { }.getType()); expectedLocation.setSyncStatus(BaseRepository.TYPE_Unsynced); List<Location> locations = Collections.singletonList(expectedLocation); when(locationRepository.getAllUnsynchedLocation()).thenReturn(locations); Mockito.doReturn("https: Mockito.doReturn(new Response<>(ResponseStatus.success, LocationServiceHelper.locationGson.toJson(locations))) .when(httpAgent).postWithJsonResponse(stringArgumentCaptor.capture(), stringArgumentCaptor.capture()); locationServiceHelper.syncUpdatedLocationsToServer(); String syncUrl = stringArgumentCaptor.getAllValues().get(0); assertEquals("https: String requestString = stringArgumentCaptor.getAllValues().get(1); assertEquals(LocationServiceHelper.locationGson.toJson(locations), requestString); verify(locationRepository).markLocationsAsSynced(expectedLocation.getId()); } |
### Question:
LocationServiceHelper extends BaseHelper { public void fetchAllLocations() { try { HTTPAgent httpAgent = getHttpAgent(); if (httpAgent == null) { throw new IllegalArgumentException(LOCATION_STRUCTURE_URL + " http agent is null"); } String baseUrl = getFormattedBaseUrl(); JSONObject request = new JSONObject(); request.put(IS_JURISDICTION, true); request.put(AllConstants.SERVER_VERSION, 0); Response<String> resp = httpAgent.post( MessageFormat.format("{0}{1}", baseUrl, LOCATION_STRUCTURE_URL), request.toString()); if (resp.isFailure()) { throw new NoHttpResponseException(LOCATION_STRUCTURE_URL + " not returned data"); } List<Location> locations = locationGson.fromJson( resp.payload(), new TypeToken<List<Location>>() { }.getType() ); for (Location location : locations) { try { location.setSyncStatus(BaseRepository.TYPE_Synced); locationRepository.addOrUpdate(location); for (LocationTag tag : location.getLocationTags()) { LocationTag locationTag = new LocationTag(); locationTag.setLocationId(location.getId()); locationTag.setName(tag.getName()); locationTagRepository.addOrUpdate(locationTag); } } catch (Exception e) { Timber.e(e, "EXCEPTION %s", e.toString()); } } } catch (Exception e) { Timber.e(e, "EXCEPTION %s", e.toString()); } } LocationServiceHelper(LocationRepository locationRepository, LocationTagRepository locationTagRepository, StructureRepository structureRepository); static LocationServiceHelper getInstance(); List<Location> fetchLocationsStructures(); void fetchLocationsByLevelAndTags(); SyncConfiguration getSyncConfiguration(); void syncCreatedStructureToServer(); void syncUpdatedLocationsToServer(); void fetchOpenMrsLocationsByTeamIds(); HTTPAgent getHttpAgent(); @NotNull String getFormattedBaseUrl(); void fetchAllLocations(); static final String LOCATION_STRUCTURE_URL; static final String CREATE_STRUCTURE_URL; static final String COMMON_LOCATIONS_SERVICE_URL; static final String OPENMRS_LOCATION_BY_TEAM_IDS; static final String STRUCTURES_LAST_SYNC_DATE; static final String LOCATION_LAST_SYNC_DATE; static Gson locationGson; }### Answer:
@Test public void testFetchAllLocations() { Mockito.doReturn(new Response<>(ResponseStatus.success, "[{\"type\":\"Feature\",\"id\":\"c2aa34c2-789b-467e-a0ab-9ea3d61632cf\",\"properties\":{\"status\":\"Active\",\"parentId\":\"\",\"name\":\"Level1\",\"geographicLevel\":1,\"version\":0},\"serverVersion\":0,\"locationTags\":[{\"id\":1,\"active\":true,\"name\":\"County\",\"description\":\"County Location Tag\"}]}," + "{\"type\":\"Feature\",\"id\":\"9dee11ba-d352-4df5-9efa-4607723b316e\",\"properties\":{\"status\":\"Active\",\"parentId\":\"c2aa34c2-789b-467e-a0ab-9ea3d61632cf\",\"name\":\"Level2\",\"geographicLevel\":2,\"version\":0},\"serverVersion\":0,\"locationTags\":[{\"id\":2,\"active\":true,\"name\":\"Subcounty\",\"description\":\"Subcounty Location Tag\"}]}]")) .when(httpAgent).post(stringArgumentCaptor.capture(), stringArgumentCaptor.capture()); locationServiceHelper.fetchAllLocations(); Mockito.verify(locationRepository, Mockito.atLeastOnce()).addOrUpdate(Mockito.any(Location.class)); String syncUrl = stringArgumentCaptor.getAllValues().get(0); assertEquals("https: String requestString = stringArgumentCaptor.getAllValues().get(1); assertEquals("{\"is_jurisdiction\":true,\"serverVersion\":0}", requestString); } |
### Question:
P2PSyncAuthorizationService implements P2PAuthorizationService { @Override public void authorizeConnection(@NonNull final Map<String, Object> peerDeviceMap, @NonNull final AuthorizationCallback authorizationCallback) { getAuthorizationDetails(new OnAuthorizationDetailsProvidedCallback() { @Override public void onAuthorizationDetailsProvided(@NonNull Map<String, Object> map) { Object peerDeviceTeamId = peerDeviceMap.get(AllConstants.PeerToPeer.KEY_TEAM_ID); if (peerDeviceTeamId != null && peerDeviceTeamId instanceof String && ((String) peerDeviceTeamId).equals(map.get(AllConstants.PeerToPeer.KEY_TEAM_ID))) { authorizationCallback.onConnectionAuthorized(); } else { authorizationCallback.onConnectionAuthorizationRejected("Incorrect authorization details provided"); } } }); } P2PSyncAuthorizationService(@NonNull String teamId); @Override void authorizeConnection(@NonNull final Map<String, Object> peerDeviceMap, @NonNull final AuthorizationCallback authorizationCallback); @Override void getAuthorizationDetails(@NonNull OnAuthorizationDetailsProvidedCallback onAuthorizationDetailsProvidedCallback); }### Answer:
@Test public void authorizeConnectionShouldCallOnConnectionAuthorizedWhenPeerDeviceTeamIdIsEqualsCurrentDeviceTeamId() { P2PAuthorizationService.AuthorizationCallback authorizationCallback = Mockito.mock(P2PAuthorizationService.AuthorizationCallback.class); HashMap<String, Object> peerDeviceMap = new HashMap<>(); peerDeviceMap.put(AllConstants.PeerToPeer.KEY_TEAM_ID, "90392-232532-dsfsdf"); p2PSyncAuthorizationService.authorizeConnection(peerDeviceMap, authorizationCallback); Mockito.verify(authorizationCallback, Mockito.times(1)).onConnectionAuthorized(); }
@Test public void authorizeConnectionShouldCallOnConnectionAuthorizationRejectedWhenPeerDeviceTeamIdsAreNotEqual() { P2PAuthorizationService.AuthorizationCallback authorizationCallback = Mockito.mock(P2PAuthorizationService.AuthorizationCallback.class); HashMap<String, Object> peerDeviceMap = new HashMap<>(); peerDeviceMap.put(AllConstants.PeerToPeer.KEY_TEAM_ID, "different-team_id"); p2PSyncAuthorizationService.authorizeConnection(peerDeviceMap, authorizationCallback); Mockito.verify(authorizationCallback, Mockito.times(1)).onConnectionAuthorizationRejected(ArgumentMatchers.eq("Incorrect authorization details provided")); } |
### Question:
FileUtilities { public static String getFileExtension(String fileName) { String extension = ""; if (fileName != null && !fileName.isEmpty()) { int i = fileName.lastIndexOf('.'); if (i > 0) { extension = fileName.substring(i + 1); } } return extension; } FileUtilities(); static Bitmap retrieveStaticImageFromDisk(String fileName); static String getFileExtension(String fileName); static String getUserAgent(Context mContext); static String getImageUrl(String entityID); void write(String fileName, String data); Writer getWriter(); String getAbsolutePath(); }### Answer:
@Test public void assertReturnsCorrectFileExtension() { Assert.assertEquals(FileUtilities.getFileExtension(FILE_NAME), "txt"); } |
### Question:
OpenSRPClientBroadCastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { try { String action = intent.getAction(); switch (action) { case Intent.ACTION_TIME_CHANGED: Timber.d("timechanged"); forceFullySignOut(); break; case Intent.ACTION_TIMEZONE_CHANGED: Timber.d("timezonechanged"); forceFullySignOut(); break; case AllConstants.CloudantSync.ACTION_DATABASE_CREATED: break; case AllConstants.CloudantSync.ACTION_REPLICATION_COMPLETED: break; case AllConstants.CloudantSync.ACTION_REPLICATION_ERROR: ((SecuredActivity) activity).showToast(context.getString(R.string.replication_error_occurred)); break; default: } } catch (Exception e) { Timber.e(e); } } OpenSRPClientBroadCastReceiver(Activity _activity); @Override void onReceive(Context context, Intent intent); }### Answer:
@Test public void onReceiveShouldLogoutUserWhenActionTimeChanged() { Intent intent = new Intent(Intent.ACTION_TIME_CHANGED); openSRPClientBroadCastReceiver.onReceive(RuntimeEnvironment.application, intent); Mockito.verify(drishtiApplication).logoutCurrentUser(); }
@Test public void onReceiveShouldLogoutUserWhenActionTimeZoneChanged() { Intent intent = new Intent(Intent.ACTION_TIMEZONE_CHANGED); openSRPClientBroadCastReceiver.onReceive(RuntimeEnvironment.application, intent); Mockito.verify(drishtiApplication).logoutCurrentUser(); }
@Test public void onReceiveShouldDoNothingWhenCloudantSyncDatabaseCreated() { Intent intent = new Intent(AllConstants.CloudantSync.ACTION_DATABASE_CREATED); openSRPClientBroadCastReceiver.onReceive(RuntimeEnvironment.application, intent); Mockito.verifyZeroInteractions(drishtiApplication); }
@Test public void onReceiveShouldDoNothingWhenCloudantSyncReplicationCompleted() { Intent intent = new Intent(AllConstants.CloudantSync.ACTION_REPLICATION_COMPLETED); openSRPClientBroadCastReceiver.onReceive(RuntimeEnvironment.application, intent); Mockito.verifyZeroInteractions(drishtiApplication); }
@Test public void onReceiveShouldShowToastWhenCloudantSyncReplicationError() { Intent intent = new Intent(AllConstants.CloudantSync.ACTION_REPLICATION_ERROR); openSRPClientBroadCastReceiver.onReceive(RuntimeEnvironment.application, intent); Mockito.verifyZeroInteractions(drishtiApplication); Mockito.verify(activity).showToast(Mockito.eq("Replication error occurred")); } |
### Question:
GZIPCompression implements ICompression { @Override public byte[] compress(String rawString) { try { ByteArrayOutputStream os = new ByteArrayOutputStream(); GZIPOutputStream gos = new GZIPOutputStream(os); gos.write(rawString.getBytes(CharEncoding.UTF_8)); gos.close(); byte[] compressed = os.toByteArray(); os.close(); return compressed; } catch (IOException e) { Timber.e(e); return null; } } @Override byte[] compress(String rawString); @Override String decompress(byte[] compressedBytes); @Override void compress(String inputFilePath, String compressedOutputFilepath); @Override void decompress(String compressedInputFilePath, String decompressedOutputFilePath); }### Answer:
@Test public void testCompressMethodReturnsACompressedOutput() throws IOException { byte[] original = TEST_STRING.getBytes(CharEncoding.UTF_8); byte[] compressed = gzipCompression.compress(TEST_STRING); Assert.assertTrue(original.length > compressed.length); }
@Test public void testCompressFileMethodReturnsACompressedOutputFile() throws IOException { String filePath = getFilePath("compression_test_file.txt"); String outputFilePath = filePath + "_compressed.gz"; File originalFile = new File(filePath); Assert.assertTrue(originalFile.length() > 0); File compressedFile = new File(outputFilePath); Assert.assertEquals(0, compressedFile.length()); gzipCompression.compress(filePath, outputFilePath); Assert.assertTrue(compressedFile.length() > 0); Assert.assertTrue(compressedFile.length() < originalFile.length()); } |
### Question:
Context { public UserService userService() { if (userService == null) { userService = new UserService(allSettings(), allSharedPreferences(), httpAgent(), session(), configuration(), saveANMLocationTask(), saveUserInfoTask(), saveANMTeamTask()); } return userService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testUserService() { UserService userService = context.userService(); Assert.assertNotNull(userService); } |
### Question:
Context { public ImageRepository imageRepository() { if (imageRepository == null) { imageRepository = new ImageRepository(); } return imageRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testImageRepository() { ImageRepository imageRepository = context.imageRepository(); Assert.assertNotNull(imageRepository); } |
### Question:
DisplayUtils { public static int getDisplayWidth(Activity activity) { DisplayMetrics displayMetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); return displayMetrics.widthPixels; } static ScreenDpi getScreenDpi(Context context); static int getDisplayWidth(Activity activity); static int getDisplayHeight(Activity activity); static double getScreenSize(Activity activity); }### Answer:
@Test public void testGetDisplayWidthReturnsCorrectWidthPixelsValue() { Mockito.doReturn(resources).when(context).getResources(); Mockito.doReturn(windowManager).when(context).getWindowManager(); DisplayManager displayManager = (DisplayManager) RuntimeEnvironment.application.getSystemService(Context.DISPLAY_SERVICE); Display display = displayManager.getDisplays()[0]; Mockito.doReturn(display).when(windowManager).getDefaultDisplay(); int defaultMetrics = display.getWidth(); int displayWidth = DisplayUtils.getDisplayWidth(context); Assert.assertTrue(displayWidth > 0); Assert.assertEquals(defaultMetrics, displayWidth); } |
### Question:
Context { public AllAlerts allAlerts() { if (allAlerts == null) { allAlerts = new AllAlerts(alertRepository()); } return allAlerts; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAllAlerts() { AllAlerts allAlerts = context.allAlerts(); Assert.assertNotNull(allAlerts); } |
### Question:
Context { public HTTPAgent httpAgent() { if (httpAgent == null) { httpAgent = new HTTPAgent(applicationContext, allSharedPreferences(), configuration()); } return httpAgent; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testHttpAgent() { HTTPAgent httpAgent = context.httpAgent(); Assert.assertNotNull(httpAgent); } |
### Question:
Context { public ANMService anmService() { if (anmService == null) { anmService = new ANMService(allSharedPreferences(), allBeneficiaries(), allEligibleCouples()); } return anmService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAnmService() { ANMService anmService = context.anmService(); Assert.assertNotNull(anmService); } |
### Question:
Context { public DristhiConfiguration configuration() { if (configuration == null) { configuration = new DristhiConfiguration(); } return configuration; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testConfiguration() { DristhiConfiguration dristhiConfiguration = context.configuration(); Assert.assertNotNull(dristhiConfiguration); } |
### Question:
Context { public ANMController anmController() { if (anmController == null) { anmController = new ANMController(anmService(), listCache(), homeContextCache()); } return anmController; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAnmController() { ANMController anmController = context.anmController(); Assert.assertNotNull(anmController); } |
### Question:
Context { public ANMLocationController anmLocationController() { if (anmLocationController == null) { anmLocationController = new ANMLocationController(allSettings(), listCache()); } return anmLocationController; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAnmLocationController() { ANMLocationController anmLocationController = context.anmLocationController(); Assert.assertNotNull(anmLocationController); } |
### Question:
Context { public HTTPAgent getHttpAgent() { return httpAgent(); } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetHttpAgent() { HTTPAgent httpAgent = context.getHttpAgent(); Assert.assertNotNull(httpAgent); } |
### Question:
Context { public EventClientRepository getEventClientRepository() { if (eventClientRepository == null) { eventClientRepository = new EventClientRepository(); } return eventClientRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetEventClientRepository() { EventClientRepository eventClientRepository = context.getEventClientRepository(); Assert.assertNotNull(eventClientRepository); } |
### Question:
Context { public UniqueIdRepository getUniqueIdRepository() { if (uniqueIdRepository == null) { uniqueIdRepository = new UniqueIdRepository(); } return uniqueIdRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetUniqueIdRepository() { UniqueIdRepository uniqueIdRepository = context.getUniqueIdRepository(); Assert.assertNotNull(uniqueIdRepository); } |
### Question:
Context { public CampaignRepository getCampaignRepository() { if (campaignRepository == null) { campaignRepository = new CampaignRepository(); } return campaignRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetCampaignRepository() { CampaignRepository campaignRepository = context.getCampaignRepository(); Assert.assertNotNull(campaignRepository); } |
### Question:
DisplayUtils { public static int getDisplayHeight(Activity activity) { DisplayMetrics displayMetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); return displayMetrics.heightPixels; } static ScreenDpi getScreenDpi(Context context); static int getDisplayWidth(Activity activity); static int getDisplayHeight(Activity activity); static double getScreenSize(Activity activity); }### Answer:
@Test public void testGetDisplayHeightReturnsCorrectHeightPixelsValue() { Mockito.doReturn(resources).when(context).getResources(); Mockito.doReturn(windowManager).when(context).getWindowManager(); DisplayManager displayManager = (DisplayManager) RuntimeEnvironment.application.getSystemService(Context.DISPLAY_SERVICE); Display display = displayManager.getDisplays()[0]; Mockito.doReturn(display).when(windowManager).getDefaultDisplay(); int defaultMetrics = display.getHeight(); int displayHeight = DisplayUtils.getDisplayHeight(context); Assert.assertTrue(displayHeight > 0); Assert.assertEquals(defaultMetrics, displayHeight); } |
### Question:
Context { public TaskRepository getTaskRepository() { if (taskRepository == null) { taskNotesRepository = new TaskNotesRepository(); taskRepository = new TaskRepository(taskNotesRepository); } return taskRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testgetTaskRepository() { TaskRepository taskRepository = context.getTaskRepository(); Assert.assertNotNull(taskRepository); } |
### Question:
Context { public BeneficiaryService beneficiaryService() { if (beneficiaryService == null) { beneficiaryService = new BeneficiaryService(allEligibleCouples(), allBeneficiaries()); } return beneficiaryService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testBeneficiaryService() { BeneficiaryService beneficiaryService = context.beneficiaryService(); Assert.assertNotNull(beneficiaryService); } |
### Question:
Context { protected DrishtiService drishtiService() { if (drishtiService == null) { drishtiService = new DrishtiService(httpAgent(), configuration().dristhiBaseURL()); } return drishtiService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testDrishtiService() { DrishtiService drishtiService = context.drishtiService(); Assert.assertNotNull(drishtiService); } |
### Question:
Context { public ActionService actionService() { if (actionService == null) { actionService = new ActionService(drishtiService(), allSettings(), allSharedPreferences(), allReports()); } return actionService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testActionService() { ActionService actionService = context.actionService(); Assert.assertNotNull(actionService); } |
### Question:
Context { public FormSubmissionService formSubmissionService() { if (formSubmissionService == null) { if (commonFtsObject != null) { formSubmissionService = new FormSubmissionService(ziggyService(), formDataRepository(), allSettings(), allCommonsRepositoryMap()); } else { formSubmissionService = new FormSubmissionService(ziggyService(), formDataRepository(), allSettings()); } } return formSubmissionService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testFormSubmissionService() { context.assignbindtypes(); FormSubmissionService formSubmissionService = context.formSubmissionService(); Assert.assertNotNull(formSubmissionService); } |
### Question:
Context { public AllFormVersionSyncService allFormVersionSyncService() { if (allFormVersionSyncService == null) { allFormVersionSyncService = new AllFormVersionSyncService(httpAgent(), configuration(), formsVersionRepository()); } return allFormVersionSyncService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAllFormVersionSyncService() { AllFormVersionSyncService allFormVersionSyncService = context.allFormVersionSyncService(); Assert.assertNotNull(allFormVersionSyncService); } |
### Question:
Context { public FormSubmissionRouter formSubmissionRouter() { if (formSubmissionRouter == null) { formSubmissionRouter = new FormSubmissionRouter(formDataRepository(), ecRegistrationHandler(), fpComplicationsHandler(), fpChangeHandler(), renewFPProductHandler(), ecCloseHandler(), ancRegistrationHandler(), ancRegistrationOAHandler(), ancVisitHandler(), ancCloseHandler(), ttHandler(), ifaHandler(), hbTestHandler(), deliveryOutcomeHandler(), pncRegistrationOAHandler(), pncCloseHandler(), pncVisitHandler(), childImmunizationsHandler(), childRegistrationECHandler(), childRegistrationOAHandler(), childCloseHandler(), childIllnessHandler(), vitaminAHandler(), deliveryPlanHandler(), ecEditHandler(), ancInvestigationsHandler()); } return formSubmissionRouter; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testFormSubmissionRouter() { FormSubmissionRouter formSubmissionRouter = context.formSubmissionRouter(); Assert.assertNotNull(formSubmissionRouter); } |
### Question:
Context { public ZiggyService ziggyService() { if (ziggyService == null) { ziggyService = new ZiggyService(ziggyFileLoader(), formDataRepository(), formSubmissionRouter()); } return ziggyService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testZiggyService() { context.assignbindtypes(); ZiggyService ziggyService = context.ziggyService(); Assert.assertNotNull(ziggyService); } |
### Question:
Context { public ZiggyFileLoader ziggyFileLoader() { if (ziggyFileLoader == null) { ziggyFileLoader = new ZiggyFileLoader("www/ziggy", "www/form", applicationContext().getAssets()); } return ziggyFileLoader; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testZiggyFileLoader() { ZiggyFileLoader ziggyFileLoader = context.ziggyFileLoader(); Assert.assertNotNull(ziggyFileLoader); } |
### Question:
Context { public FormSubmissionSyncService formSubmissionSyncService() { if (formSubmissionSyncService == null) { formSubmissionSyncService = new FormSubmissionSyncService(formSubmissionService(), httpAgent(), formDataRepository(), allSettings(), allSharedPreferences(), configuration()); } return formSubmissionSyncService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testFormSubmissionSyncService() { FormSubmissionSyncService formSubmissionSyncService = context.formSubmissionSyncService(); Assert.assertNotNull(formSubmissionSyncService); } |
### Question:
DisplayUtils { public static double getScreenSize(Activity activity) { DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); int width = dm.widthPixels; int height = dm.heightPixels; double wi = (double) width / (double) dm.xdpi; double hi = (double) height / (double) dm.ydpi; double x = Math.pow(wi, 2); double y = Math.pow(hi, 2); return Math.sqrt(x + y); } static ScreenDpi getScreenDpi(Context context); static int getDisplayWidth(Activity activity); static int getDisplayHeight(Activity activity); static double getScreenSize(Activity activity); }### Answer:
@Test public void testGetScreenSizeReturnsCorrectValues() { Mockito.doReturn(resources).when(context).getResources(); Mockito.doReturn(windowManager).when(context).getWindowManager(); DisplayManager displayManager = (DisplayManager) RuntimeEnvironment.application.getSystemService(Context.DISPLAY_SERVICE); Display display = displayManager.getDisplays()[0]; Mockito.doReturn(display).when(windowManager).getDefaultDisplay(); double screenSize = DisplayUtils.getScreenSize(context); Assert.assertEquals(3.5, screenSize, 0.1); } |
### Question:
Context { public DrishtiRepository[] sharedRepositoriesArray() { ArrayList<DrishtiRepository> drishtiRepositories = sharedRepositories(); DrishtiRepository[] drishtireposotoryarray = drishtiRepositories .toArray(new DrishtiRepository[drishtiRepositories.size()]); return drishtireposotoryarray; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testSharedRepositoriesArray() { DrishtiRepository[] sharedRepositoriesArray = context.sharedRepositoriesArray(); Assert.assertEquals(sharedRepositoriesArray.length, 12); } |
### Question:
Context { public AllTimelineEvents allTimelineEvents() { if (allTimelineEvents == null) { allTimelineEvents = new AllTimelineEvents(timelineEventRepository()); } return allTimelineEvents; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAllTimelineEvents() { AllTimelineEvents allTimelineEvents = context.allTimelineEvents(); Assert.assertNotNull(allTimelineEvents); } |
### Question:
Context { public AllReports allReports() { if (allReports == null) { allReports = new AllReports(reportRepository()); } return allReports; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAllReports() { AllReports allReports = context.allReports(); Assert.assertNotNull(allReports); } |
### Question:
Context { public AllServicesProvided allServicesProvided() { if (allServicesProvided == null) { allServicesProvided = new AllServicesProvided(serviceProvidedRepository()); } return allServicesProvided; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAllServicesProvided() { AllServicesProvided allServicesProvided = context.allServicesProvided(); Assert.assertNotNull(allServicesProvided); } |
### Question:
Context { public DetailsRepository detailsRepository() { if (detailsRepository == null) { detailsRepository = new DetailsRepository(); } return detailsRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testDetailsRepository() { DetailsRepository detailsRepository = context.detailsRepository(); Assert.assertNotNull(detailsRepository); } |
### Question:
Context { public FormDataRepository formDataRepository() { if (formDataRepository == null) { formDataRepository = new FormDataRepository(); } return formDataRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testFormDataRepository() { context.assignbindtypes(); FormDataRepository formDataRepository = context.formDataRepository(); Assert.assertNotNull(formDataRepository); } |
### Question:
Context { public AlertService alertService() { if (alertService == null) { if (commonFtsObject() != null) { alertService = new AlertService(alertRepository(), commonFtsObject(), allCommonsRepositoryMap()); } else { alertService = new AlertService(alertRepository()); } } return alertService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testAlertService() { AlertService alertService = context.alertService(); Assert.assertNotNull(alertService); } |
### Question:
Context { public ServiceProvidedService serviceProvidedService() { if (serviceProvidedService == null) { serviceProvidedService = new ServiceProvidedService(allServicesProvided()); } return serviceProvidedService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testServiceProvidedService() { ServiceProvidedService serviceProvidedService = context.serviceProvidedService(); Assert.assertNotNull(serviceProvidedService); } |
### Question:
Context { public EligibleCoupleService eligibleCoupleService() { if (eligibleCoupleService == null) { eligibleCoupleService = new EligibleCoupleService(allEligibleCouples(), allTimelineEvents(), allBeneficiaries()); } return eligibleCoupleService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testEligibleCoupleService() { EligibleCoupleService eligibleCoupleService = context.eligibleCoupleService(); Assert.assertNotNull(eligibleCoupleService); } |
### Question:
CredentialsHelper { public static boolean shouldMigrate() { return CoreLibrary.getInstance().context().allSharedPreferences().getDBEncryptionVersion() == 0 || (CoreLibrary.getInstance().context().allSharedPreferences().getDBEncryptionVersion() > 0 && BuildConfig.DB_ENCRYPTION_VERSION > CoreLibrary.getInstance().context().allSharedPreferences().getDBEncryptionVersion()); } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); }### Answer:
@Test public void testShouldMigrateReturnsTrueForDBEncryptionVersionZero() { boolean shouldMigrate = CredentialsHelper.shouldMigrate(); Assert.assertTrue(shouldMigrate); } |
### Question:
ClientFormResponse { public ClientFormDTO getClientForm() { return clientForm; } ClientFormResponse(ClientFormDTO clientForm, ClientFormMetadataDTO clientFormMetadata); ClientFormDTO getClientForm(); void setClientForm(ClientFormDTO clientForm); ClientFormMetadataDTO getClientFormMetadata(); void setClientFormMetadata(ClientFormMetadataDTO clientFormMetadata); }### Answer:
@Test public void getClientForm() { ClientFormDTO clientFormDTO = new ClientFormDTO(); clientFormDTO.setId(1); clientFormDTO.setJson("[\"test json\"]"); ClientFormMetadataDTO clientFormMetadataDTO = new ClientFormMetadataDTO(); Date now = Calendar.getInstance().getTime(); clientFormMetadataDTO.setCreatedAt(now); clientFormMetadataDTO.setId(1L); clientFormMetadataDTO.setIdentifier("referral/anc_form"); clientFormMetadataDTO.setJurisdiction("test jurisdiction"); clientFormMetadataDTO.setLabel("ANC Referral form"); clientFormMetadataDTO.setModule("ANC"); clientFormMetadataDTO.setVersion("0.0.1"); ClientFormResponse clientFormResponse = new ClientFormResponse(clientFormDTO, clientFormMetadataDTO); Assert.assertEquals("referral/anc_form", clientFormResponse.getClientFormMetadata().getIdentifier()); Assert.assertEquals("test jurisdiction", clientFormResponse.getClientFormMetadata().getJurisdiction()); Assert.assertEquals("ANC Referral form", clientFormResponse.getClientFormMetadata().getLabel()); Assert.assertEquals("ANC", clientFormResponse.getClientFormMetadata().getModule()); Assert.assertEquals("0.0.1", clientFormResponse.getClientFormMetadata().getVersion()); Assert.assertEquals(now, clientFormResponse.getClientFormMetadata().getCreatedAt()); Assert.assertEquals(1, clientFormResponse.getClientForm().getId()); Assert.assertEquals("[\"test json\"]", clientFormResponse.getClientForm().getJson()); } |
### Question:
Context { public MotherService motherService() { if (motherService == null) { motherService = new MotherService(allBeneficiaries(), allEligibleCouples(), allTimelineEvents(), serviceProvidedService()); } return motherService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testmotherService() { MotherService motherService = context.motherService(); Assert.assertNotNull(motherService); } |
### Question:
Context { public ChildService childService() { if (childService == null) { childService = new ChildService(allBeneficiaries(), motherRepository(), childRepository(), allTimelineEvents(), serviceProvidedService(), allAlerts()); } return childService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testChildService() { ChildService childService = context.childService(); Assert.assertNotNull(childService); } |
### Question:
Context { public PendingFormSubmissionService pendingFormSubmissionService() { if (pendingFormSubmissionService == null) { pendingFormSubmissionService = new PendingFormSubmissionService(formDataRepository()); } return pendingFormSubmissionService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testPendingFormSubmissionService() { context.assignbindtypes(); PendingFormSubmissionService pendingFormSubmissionService = context.pendingFormSubmissionService(); Assert.assertNotNull(pendingFormSubmissionService); } |
### Question:
Context { public LocationRepository getLocationRepository() { if (locationRepository == null) { locationRepository = new LocationRepository(); } return locationRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testLocationRepository() { LocationRepository locationRepository = context.getLocationRepository(); Assert.assertNotNull(locationRepository); } |
### Question:
Context { public LocationTagRepository getLocationTagRepository() { if (locationTagRepository == null) { locationTagRepository = new LocationTagRepository(); } return locationTagRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetLocationTagRepository() { LocationTagRepository locationTagRepository = context.getLocationTagRepository(); Assert.assertNotNull(locationTagRepository); } |
### Question:
Context { public StructureRepository getStructureRepository() { if (structureRepository == null) { structureRepository = new StructureRepository(); } return structureRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetStructureRepository() { StructureRepository structureRepository = context.getStructureRepository(); Assert.assertNotNull(structureRepository); } |
### Question:
Context { public PlanDefinitionRepository getPlanDefinitionRepository() { if (planDefinitionRepository == null) { planDefinitionRepository = new PlanDefinitionRepository(); } return planDefinitionRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetPlanDefinitionRepository() { PlanDefinitionRepository planDefinitionRepository = context.getPlanDefinitionRepository(); Assert.assertNotNull(planDefinitionRepository); } |
### Question:
Context { public ManifestRepository getManifestRepository() { if (manifestRepository == null) { manifestRepository = new ManifestRepository(); } return manifestRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetManifestRepository() { ManifestRepository manifestRepository = context.getManifestRepository(); Assert.assertNotNull(manifestRepository); } |
### Question:
Context { public ClientFormRepository getClientFormRepository() { if (clientFormRepository == null) { clientFormRepository = new ClientFormRepository(); } return clientFormRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; }### Answer:
@Test public void testGetClientFormRepository() { ClientFormRepository clientFormRepository = context.getClientFormRepository(); Assert.assertNotNull(clientFormRepository); } |
### Question:
AllCommonsRepository { public long count() { return personRepository.count(); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void ShouldShowcount() throws Exception { when(personRepository.count()).thenReturn((long) 8); assertEquals(personRepository.count(), (long) 8); }
@Test public void testCount() { allCommonsRepository.count(); verify(personRepository).count(); } |
### Question:
CredentialsHelper { public byte[] getCredentials(String username, String type) { if (CREDENTIALS_TYPE.DB_AUTH.equals(type)) { return context.userService().getDecryptedPassphraseValue(username); } else if (CREDENTIALS_TYPE.LOCAL_AUTH.equals(type)) { return context.userService().getDecryptedAccountValue(username, AccountHelper.INTENT_KEY.ACCOUNT_LOCAL_PASSWORD); } return null; } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); }### Answer:
@Test public void testGetCredentialsInvokesGetDecryptedPassphraseValueWithCorrectValuesForDBAuth() { credentialsHelper.getCredentials(TEST_USERNAME, CredentialsHelper.CREDENTIALS_TYPE.DB_AUTH); ArgumentCaptor<String> usernameArgCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(userService, Mockito.times(1)).getDecryptedPassphraseValue(usernameArgCaptor.capture()); Assert.assertEquals(TEST_USERNAME, usernameArgCaptor.getValue()); }
@Test public void testGetCredentialsInvokesGetDecryptedPassphraseValueWithCorrectValuesForLocalAuth() { credentialsHelper.getCredentials(TEST_USERNAME, CredentialsHelper.CREDENTIALS_TYPE.LOCAL_AUTH); ArgumentCaptor<String> usernameArgCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> keyArgCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(userService, Mockito.times(1)).getDecryptedAccountValue(usernameArgCaptor.capture(), keyArgCaptor.capture()); Assert.assertEquals(TEST_USERNAME, usernameArgCaptor.getValue()); Assert.assertEquals(AccountHelper.INTENT_KEY.ACCOUNT_LOCAL_PASSWORD, keyArgCaptor.getValue()); } |
### Question:
AllCommonsRepository { public List<CommonPersonObject> all() { return personRepository.allcommon(); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testAll() { allCommonsRepository.all(); verify(personRepository).allcommon(); } |
### Question:
AllCommonsRepository { public CommonPersonObject findByCaseID(String caseId) { return personRepository.findByCaseID(caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testFindByCaseId() { allCommonsRepository.findByCaseID("case 1"); verify(personRepository).findByCaseID("case 1"); } |
### Question:
AllCommonsRepository { public CommonPersonObject findHHByGOBHHID(String gobhhid) { return personRepository.findHHByGOBHHID(gobhhid); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testFindHHByGOBHHID() { allCommonsRepository.findHHByGOBHHID("gobhhid 1"); verify(personRepository).findHHByGOBHHID("gobhhid 1"); } |
### Question:
AllCommonsRepository { public List<CommonPersonObject> findByCaseIDs(List<String> caseIds) { return personRepository.findByCaseIDs(caseIds.toArray(new String[caseIds.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testFindByCaseIds() { List<String> expectedCaseIds = new ArrayList<>(); expectedCaseIds.add("case 1"); expectedCaseIds.add("case 2"); allCommonsRepository.findByCaseIDs(expectedCaseIds); verify(personRepository).findByCaseIDs(new String[] {expectedCaseIds.get(0), expectedCaseIds.get(1)}); } |
### Question:
AllCommonsRepository { public List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID) { return personRepository .findByRelationalIDs(RelationalID.toArray(new String[RelationalID.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testFindByRelationIds() { List<String> expectedRelationIds = new ArrayList<>(); expectedRelationIds.add("relation id 1"); expectedRelationIds.add("relation id 2"); allCommonsRepository.findByRelationalIDs(expectedRelationIds); verify(personRepository).findByRelationalIDs(new String[] {expectedRelationIds.get(0), expectedRelationIds.get(1)}); } |
### Question:
AllCommonsRepository { public List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID) { return personRepository .findByRelational_IDs(RelationalID.toArray(new String[RelationalID.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testFindByRelationIds2() { List<String> expectedRelationIds = new ArrayList<>(); expectedRelationIds.add("relation id 1"); expectedRelationIds.add("relation id 2"); allCommonsRepository.findByRelational_IDs(expectedRelationIds); verify(personRepository).findByRelational_IDs(new String[] {expectedRelationIds.get(0), expectedRelationIds.get(1)}); } |
### Question:
AllCommonsRepository { public void close(String entityId) { alertRepository.deleteAllAlertsForEntity(entityId); timelineEventRepository.deleteAllTimelineEventsForEntity(entityId); personRepository.close(entityId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testClose() { String entityId = "Entity 1"; allCommonsRepository.close(entityId); verify(alertRepository).deleteAllAlertsForEntity(entityId); verify(timelineEventRepository).deleteAllTimelineEventsForEntity(entityId); verify(personRepository).close(entityId); } |
### Question:
AllCommonsRepository { public void mergeDetails(String entityId, Map<String, String> details) { personRepository.mergeDetails(entityId, details); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testMergeDetails() { String entityId = "Entity 1"; Map<String, String> details = new HashMap<>(); details.put("case id", "Case 1"); allCommonsRepository.mergeDetails(entityId, details); verify(personRepository).mergeDetails(entityId, details); } |
### Question:
AllCommonsRepository { public void update(String tableName, ContentValues contentValues, String caseId) { personRepository.updateColumn(tableName, contentValues, caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testUpdate() { String tableName = "sprayed_structures"; String caseId = "Case 1"; ContentValues contentValues = new ContentValues(); contentValues.put("status", "Ready"); allCommonsRepository.update(tableName, contentValues, caseId); verify(personRepository).updateColumn(tableName,contentValues,caseId); } |
### Question:
AllCommonsRepository { public List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName) { return personRepository.customQuery(sql, selections, tableName); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testCustomQuery() { String tableName = "sprayed_structures"; String sql = "SELECT count(*) FROM sprayed_structures WHERE status = ?"; String[] selectionArgs = {"Complete"}; allCommonsRepository.customQuery(sql, selectionArgs, tableName); verify(personRepository).customQuery(sql, selectionArgs, tableName); } |
### Question:
AllCommonsRepository { public List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections, String tableName) { return personRepository.customQueryForCompleteRow(sql, selections, tableName); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testCustomQueryForCompleteRow() { String tableName = "sprayed_structures"; String sql = "SELECT count(*) FROM sprayed_structures WHERE status = ?"; String[] selectionArgs = {"Complete"}; allCommonsRepository.customQueryForCompleteRow(sql, selectionArgs, tableName); verify(personRepository).customQueryForCompleteRow(sql, selectionArgs, tableName); } |
### Question:
AllCommonsRepository { public boolean deleteSearchRecord(String caseId) { if (StringUtils.isBlank(caseId)) { return false; } return personRepository.deleteSearchRecord(caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); }### Answer:
@Test public void testDeleteSearchRecord() { String caseId = "Case id 1"; allCommonsRepository.deleteSearchRecord(caseId); verify(personRepository).deleteSearchRecord(caseId); } |
### Question:
CommonRepository extends DrishtiRepository { public void add(CommonPersonObject common) { SQLiteDatabase database = masterRepository.getWritableDatabase(); database.insert(TABLE_NAME, null, createValuesFor(common)); } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; }### Answer:
@Test public void addCallsDatabaseInsert1times() throws Exception { String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); commonRepository.add(new CommonPersonObject("", "", new HashMap<String, String>(), "")); Mockito.verify(sqliteDatabase, Mockito.times(1)).insert(Mockito.anyString(), Mockito.isNull(String.class), Mockito.any(ContentValues.class)); } |
### Question:
CredentialsHelper { public void saveCredentials(String type, String encryptedPassphrase) { if (CREDENTIALS_TYPE.DB_AUTH.equals(type)) { allSharedPreferences.savePassphrase(encryptedPassphrase, CoreLibrary.getInstance().getSyncConfiguration().getEncryptionParam().name()); allSharedPreferences.setDBEncryptionVersion(BuildConfig.DB_ENCRYPTION_VERSION); } } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); }### Answer:
@Test public void testSaveCredentialsUpdatesSharedPreferencesWithEncryptedPassphrase() { Mockito.doReturn(syncConfiguration).when(coreLibrary).getSyncConfiguration(); Mockito.doReturn(SyncFilter.TEAM_ID).when(syncConfiguration).getEncryptionParam(); credentialsHelper.saveCredentials(CredentialsHelper.CREDENTIALS_TYPE.DB_AUTH, TEST_ENCRYPTED_PWD); ArgumentCaptor<String> encryptionValueArgCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> encryptionParamArgCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(allSharedPreferences, Mockito.times(1)).savePassphrase(encryptionValueArgCaptor.capture(), encryptionParamArgCaptor.capture()); Assert.assertEquals(TEST_ENCRYPTED_PWD, encryptionValueArgCaptor.getValue()); Assert.assertEquals(SyncFilter.TEAM_ID.name(), encryptionParamArgCaptor.getValue()); }
@Test public void testSaveCredentialsUpdatesSharedPreferencesWithNewDBEncryptionVersion() { Mockito.doReturn(SyncFilter.LOCATION_ID).when(syncConfiguration).getEncryptionParam(); credentialsHelper.saveCredentials(CredentialsHelper.CREDENTIALS_TYPE.DB_AUTH, TEST_ENCRYPTED_PWD); ArgumentCaptor<Integer> encryptionValueArgCaptor = ArgumentCaptor.forClass(Integer.class); Mockito.verify(allSharedPreferences, Mockito.times(1)).setDBEncryptionVersion(encryptionValueArgCaptor.capture()); Assert.assertEquals((Integer) BuildConfig.DB_ENCRYPTION_VERSION, encryptionValueArgCaptor.getValue()); } |
### Question:
CommonRepository extends DrishtiRepository { public CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor) { int columncount = cursor.getColumnCount(); HashMap<String, String> columns = new HashMap<String, String>(); for (int i = 0; i < columncount; i++) { String columnName = cursor.getColumnName(i); String value = cursor.getString(cursor.getColumnIndex(columnName)); columns.put(columnName, value); } CommonPersonObject common = getCommonPersonObjectFromCursor(cursor); common.setColumnmaps(columns); return common; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; }### Answer:
@Test public void readAllcommonforCursorAdapterReturnsNotNUll() throws Exception { String[] columns = new String[]{"_id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{"caseID", "relationalID", new HashMap<String, String>(), 0}); matrixCursor.addRow(new Object[]{"caseID2", "relationalID2", new HashMap<String, String>(), 0}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); matrixCursor.moveToFirst(); Assert.assertNotNull(commonRepository.readAllcommonforCursorAdapter(matrixCursor)); } |
### Question:
CommonRepository extends DrishtiRepository { public List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName) { List<CommonPersonObject> commons = new ArrayList<CommonPersonObject>(); try { cursor.moveToFirst(); while (!cursor.isAfterLast()) { int columncount = cursor.getColumnCount(); HashMap<String, String> columns = new HashMap<String, String>(); for (int i = 0; i < columncount; i++) { columns.put(cursor.getColumnName(i), String.valueOf(cursor.getInt(i))); } CommonPersonObject common = new CommonPersonObject("1", "0", null, tableName); common.setClosed((short) 0); common.setColumnmaps(columns); commons.add(common); cursor.moveToNext(); } } catch (Exception e) { Timber.e(e); } finally { cursor.close(); } return commons; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; }### Answer:
@Test public void readAllcommonforFieldReturnsNotNUll() throws Exception { String[] columns = new String[]{"_id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{0, 0, 0, 0}); matrixCursor.addRow(new Object[]{1, 1, 1, 1}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); matrixCursor.moveToFirst(); Assert.assertNotNull(commonRepository.readAllcommonForField(matrixCursor, "")); } |
### Question:
CommonRepository extends DrishtiRepository { public void closeCase(String baseEntityId, String tableName) { try { SQLiteDatabase db = masterRepository.getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put(IS_CLOSED_COLUMN, 1); db.update(tableName, cv, BASE_ENTITY_ID_COLUMN + "=?", new String[]{baseEntityId}); } catch (Exception e) { Timber.e(e); } } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; }### Answer:
@Test public void assertCloseCaseCallsDatabaseExec() { String tablename = "table"; String baseEntityId = "1"; String[] tableColumns = new String[]{CommonRepository.Relational_Underscore_ID, CommonRepository.BASE_ENTITY_ID_COLUMN, ADDITIONALCOLUMN, CUSTOMRELATIONALID}; commonFtsObject = Mockito.mock(CommonFtsObject.class); CommonRepository commonRepository = new CommonRepository(commonFtsObject, tablename, tableColumns); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); repository = Mockito.mock(Repository.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); commonRepository.closeCase(baseEntityId, tablename); commonRepository.updateMasterRepository(repository); commonRepository.closeCase(baseEntityId, tablename); Mockito.verify(sqliteDatabase,Mockito.times(1)).update(Mockito.anyString(), Mockito.any(ContentValues.class), Mockito.anyString(),Mockito.any(String[].class)); } |
### Question:
CommonRepository extends DrishtiRepository { public boolean deleteCase(String baseEntityId, String tableName) { try { SQLiteDatabase db = masterRepository.getWritableDatabase(); int afftectedRows = db .delete(tableName, BASE_ENTITY_ID_COLUMN + " = ? COLLATE NOCASE" + " ", new String[]{baseEntityId}); if (afftectedRows > 0) { return true; } } catch (Exception e) { Timber.e(e); } return false; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; }### Answer:
@Test public void assertDeleteCaseCallsDatabaseExec() { String tablename = "table"; String baseEntityId = "1"; String[] tableColumns = new String[]{CommonRepository.Relational_Underscore_ID, CommonRepository.BASE_ENTITY_ID_COLUMN, ADDITIONALCOLUMN, CUSTOMRELATIONALID}; commonFtsObject = Mockito.mock(CommonFtsObject.class); CommonRepository commonRepository = new CommonRepository(commonFtsObject, tablename, tableColumns); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); repository = Mockito.mock(Repository.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); Assert.assertEquals(commonRepository.deleteCase(baseEntityId, tablename), false); Mockito.when(sqliteDatabase.delete(Mockito.anyString(), Mockito.anyString(), Mockito.any(String[].class))).thenReturn(1); commonRepository.updateMasterRepository(repository); Assert.assertEquals(commonRepository.deleteCase(baseEntityId, tablename), true); } |
### Question:
CommonFtsObject { public static String searchTableName(String table) { return table + "_search"; } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateSearchFields(String table, String[] searchFields); void updateSortFields(String table, String[] sortFields); void updateMainConditions(String table, String[] mainConditions); void updateCustomRelationalId(String table, String customRelationalId); void updateAlertScheduleMap(Map<String, Pair<String, Boolean>> alertsScheduleMap); void updateAlertFilterVisitCodes(String[] alertFilterVisitCodes); String[] getTables(); String[] getSearchFields(String table); String[] getSortFields(String table); String[] getMainConditions(String table); String getCustomRelationalId(String table); String getAlertBindType(String schedule); Boolean alertUpdateVisitCode(String schedule); String getAlertScheduleName(String vaccineName); String[] getAlertFilterVisitCodes(); boolean containsTable(String table); static final String idColumn; static final String relationalIdColumn; static final String phraseColumn; static final String isClosedColumn; static final String isClosedColumnName; }### Answer:
@Test public void testSearchTableNameShouldReturnCorrectSearchTableName() { assertEquals("table1_search", commonFtsObject.searchTableName("table1")); } |
### Question:
CommonFtsObject { public boolean containsTable(String table) { if (tables == null || StringUtils.isBlank(table)) { return false; } List<String> tableList = Arrays.asList(tables); return tableList.contains(table); } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateSearchFields(String table, String[] searchFields); void updateSortFields(String table, String[] sortFields); void updateMainConditions(String table, String[] mainConditions); void updateCustomRelationalId(String table, String customRelationalId); void updateAlertScheduleMap(Map<String, Pair<String, Boolean>> alertsScheduleMap); void updateAlertFilterVisitCodes(String[] alertFilterVisitCodes); String[] getTables(); String[] getSearchFields(String table); String[] getSortFields(String table); String[] getMainConditions(String table); String getCustomRelationalId(String table); String getAlertBindType(String schedule); Boolean alertUpdateVisitCode(String schedule); String getAlertScheduleName(String vaccineName); String[] getAlertFilterVisitCodes(); boolean containsTable(String table); static final String idColumn; static final String relationalIdColumn; static final String phraseColumn; static final String isClosedColumn; static final String isClosedColumnName; }### Answer:
@Test public void testContainsTableShouldReturnCorrectStatus() { assertTrue(commonFtsObject.containsTable("table1")); assertFalse(commonFtsObject.containsTable("table100")); } |
### Question:
CommonFtsObject { public String[] getTables() { if (tables == null) { tables = ArrayUtils.EMPTY_STRING_ARRAY; } return tables; } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateSearchFields(String table, String[] searchFields); void updateSortFields(String table, String[] sortFields); void updateMainConditions(String table, String[] mainConditions); void updateCustomRelationalId(String table, String customRelationalId); void updateAlertScheduleMap(Map<String, Pair<String, Boolean>> alertsScheduleMap); void updateAlertFilterVisitCodes(String[] alertFilterVisitCodes); String[] getTables(); String[] getSearchFields(String table); String[] getSortFields(String table); String[] getMainConditions(String table); String getCustomRelationalId(String table); String getAlertBindType(String schedule); Boolean alertUpdateVisitCode(String schedule); String getAlertScheduleName(String vaccineName); String[] getAlertFilterVisitCodes(); boolean containsTable(String table); static final String idColumn; static final String relationalIdColumn; static final String phraseColumn; static final String isClosedColumn; static final String isClosedColumnName; }### Answer:
@Test public void testGetTablesShouldGetAllTables() { assertEquals(tables, commonFtsObject.getTables()); } |
### Question:
CommonObjectFilterOption implements FilterOption { @Override public boolean filter(SmartRegisterClient client) { switch (byColumnAndByDetails) { case byColumn: return ((CommonPersonObjectClient) client).getColumnmaps().get(fieldname). contains(criteria); case byDetails: return (((CommonPersonObjectClient) client).getDetails().get(fieldname) != null ? ((CommonPersonObjectClient) client).getDetails().get(fieldname) : ""). toLowerCase().contains(criteria.toLowerCase()); } return false; } CommonObjectFilterOption(String criteriaArg, String fieldnameArg, ByColumnAndByDetails
byColumnAndByDetailsArg, String filteroptionnameArg); @Override String name(); @Override boolean filter(SmartRegisterClient client); final String fieldname; }### Answer:
@Test public void testFilterByColumn() { Map<String, String> column1 = EasyMap.create("name", "Woman A").map(); CommonPersonObjectClient expectedClient = new CommonPersonObjectClient("entity id 1", emptyMap, "Woman A"); expectedClient.setColumnmaps(column1); boolean filter = commonObjectFilterOption.filter(expectedClient); assertTrue(filter); }
@Test public void testFilterByDetails() { commonObjectFilterOption = new CommonObjectFilterOption(criteria, fieldname, byDetails, filterOptionName); Map<String, String> detail = EasyMap.create("name", "Woman A").map(); CommonPersonObjectClient expectedClient = new CommonPersonObjectClient("entity id 1", detail, "Woman A"); expectedClient.setColumnmaps(emptyMap); boolean filter = commonObjectFilterOption.filter(expectedClient); assertTrue(filter); } |
### Question:
CredentialsHelper { public PasswordHash generateLocalAuthCredentials(char[] password) throws InvalidKeySpecException, NoSuchAlgorithmException { if (password == null) return null; return SecurityHelper.getPasswordHash(password); } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); }### Answer:
@Test public void generateLocalAuthCredentials() throws Exception { Assert.assertNotNull(credentialsHelper); PowerMockito.mockStatic(SecurityHelper.class); PowerMockito.when(SecurityHelper.getPasswordHash(TEST_DUMMY_PASSWORD)).thenReturn(null); credentialsHelper.generateLocalAuthCredentials(TEST_DUMMY_PASSWORD); PowerMockito.verifyStatic(SecurityHelper.class); SecurityHelper.getPasswordHash(TEST_DUMMY_PASSWORD); } |
### Question:
CommonObjectFilterOption implements FilterOption { @Override public String name() { return filterOptionName; } CommonObjectFilterOption(String criteriaArg, String fieldnameArg, ByColumnAndByDetails
byColumnAndByDetailsArg, String filteroptionnameArg); @Override String name(); @Override boolean filter(SmartRegisterClient client); final String fieldname; }### Answer:
@Test public void testFilterOptionName() { assertEquals(filterOptionName, commonObjectFilterOption.name()); } |
### Question:
AccountHelper { public static Account getOauthAccountByNameAndType(String accountName, String accountType) { Account[] accounts = accountManager.getAccountsByType(accountType); return accounts.length > 0 ? selectAccount(accounts, accountName) : null; } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; }### Answer:
@Test public void testGetOauthAccountByType() { Account account = AccountHelper.getOauthAccountByNameAndType(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE); Assert.assertNotNull(account); Assert.assertEquals(CORE_ACCOUNT_NAME, account.name); } |
### Question:
AccountHelper { public static String getAccountManagerValue(String key, String accountName, String accountType) { Account account = AccountHelper.getOauthAccountByNameAndType(accountName, accountType); if (account != null) { return accountManager.getUserData(account, key); } return null; } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; }### Answer:
@Test public void testGetAccountManagerValue() { Whitebox.setInternalState(AccountHelper.class, "accountManager", accountManager); Mockito.doReturn(TEST_VALUE).when(accountManager).getUserData(ArgumentMatchers.any(Account.class), ArgumentMatchers.eq(TEST_KEY)); String value = AccountHelper.getAccountManagerValue(TEST_KEY, CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE); Assert.assertNotNull(value); Assert.assertEquals(TEST_VALUE, value); } |
### Question:
AccountHelper { public static String getOAuthToken(String accountName, String accountType, String authTokenType) { Account account = getOauthAccountByNameAndType(accountName, accountType); try { return accountManager.blockingGetAuthToken(account, authTokenType, true); } catch (Exception ex) { Timber.e(ex, "EXCEPTION: %s", ex.toString()); return null; } } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; }### Answer:
@Test public void testGetOAuthToken() throws AuthenticatorException, OperationCanceledException, IOException { Mockito.doReturn(TEST_TOKEN_VALUE).when(accountManager).blockingGetAuthToken(new Account(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE), AUTH_TOKEN_TYPE, true); String myToken = AccountHelper.getOAuthToken(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE, AUTH_TOKEN_TYPE); Assert.assertNotNull(myToken); Assert.assertEquals(TEST_TOKEN_VALUE, myToken); } |
### Question:
AccountHelper { public static void invalidateAuthToken(String accountType, String authToken) { if (authToken != null) accountManager.invalidateAuthToken(accountType, authToken); } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; }### Answer:
@Test public void testInvalidateAuthToken() { AccountHelper.invalidateAuthToken(CORE_ACCOUNT_TYPE, TEST_TOKEN_VALUE); Mockito.verify(accountManager).invalidateAuthToken(CORE_ACCOUNT_TYPE, TEST_TOKEN_VALUE); } |
### Question:
AccountHelper { public static String getCachedOAuthToken(String accountName, String accountType, String authTokenType) { Account account = getOauthAccountByNameAndType(accountName, accountType); return account != null ? accountManager.peekAuthToken(account, authTokenType) : null; } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; }### Answer:
@Test public void testGetCachedOAuthToken() { Account account = new Account(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE); Mockito.doReturn(TEST_TOKEN_VALUE).when(accountManager).peekAuthToken(account, AUTH_TOKEN_TYPE); String cachedAuthToken = AccountHelper.getCachedOAuthToken(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE, AUTH_TOKEN_TYPE); Mockito.verify(accountManager).peekAuthToken(account, AUTH_TOKEN_TYPE); Assert.assertEquals(TEST_TOKEN_VALUE, cachedAuthToken); } |
### Question:
CredentialsHelper { public byte[] generateDBCredentials(char[] password, LoginResponseData userInfo) { char[] encryptionParamValue = null; SyncConfiguration syncConfiguration = CoreLibrary.getInstance().getSyncConfiguration(); if (syncConfiguration.getEncryptionParam() != null) { SyncFilter syncFilter = syncConfiguration.getEncryptionParam(); if (SyncFilter.TEAM.equals(syncFilter) || SyncFilter.TEAM_ID.equals(syncFilter)) { encryptionParamValue = context.userService().getUserDefaultTeamId(userInfo).toCharArray(); } else if (SyncFilter.LOCATION.equals(syncFilter) || SyncFilter.LOCATION_ID.equals(syncFilter)) { encryptionParamValue = context.userService().getUserLocationId(userInfo).toCharArray(); } else if (SyncFilter.PROVIDER.equals(syncFilter)) { encryptionParamValue = password; } } if (encryptionParamValue == null || encryptionParamValue.length < 1) { return null; } return SecurityHelper.toBytes(encryptionParamValue); } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); }### Answer:
@Test public void testGenerateDBCredentialsReturnsCorrectBytesForSyncByProvider() { Mockito.doReturn(SyncFilter.PROVIDER).when(syncConfiguration).getEncryptionParam(); byte[] bytes = credentialsHelper.generateDBCredentials(TEST_DUMMY_PASSWORD, userInfo); Assert.assertTrue(Arrays.equals(SecurityHelper.toBytes(TEST_DUMMY_PASSWORD), bytes)); }
@Test public void testGenerateDBCredentialsReturnsCorrectBytesForSyncByTeam() { Mockito.doReturn(SyncFilter.TEAM_ID).when(syncConfiguration).getEncryptionParam(); Mockito.doReturn(TEST_TEAM_ID).when(userService).getUserDefaultTeamId(userInfo); byte[] bytes = credentialsHelper.generateDBCredentials(TEST_DUMMY_PASSWORD, userInfo); Assert.assertTrue(Arrays.equals(SecurityHelper.toBytes(TEST_TEAM_ID.toCharArray()), bytes)); }
@Test public void testGenerateDBCredentialsReturnsCorrectBytesForSyncByLocation() { Mockito.doReturn(SyncFilter.LOCATION_ID).when(syncConfiguration).getEncryptionParam(); Mockito.doReturn(TEST_LOCATION_ID).when(userService).getUserLocationId(userInfo); byte[] bytes = credentialsHelper.generateDBCredentials(TEST_DUMMY_PASSWORD, userInfo); Assert.assertTrue(Arrays.equals(SecurityHelper.toBytes(TEST_LOCATION_ID.toCharArray()), bytes)); } |
### Question:
AccountHelper { public static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType) { Account account = getOauthAccountByNameAndType(accountName, accountType); return accountManager.updateCredentials(account, authTokenType, null, null, null, null); } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; }### Answer:
@Test public void testReAuthenticateUserAfterSessionExpired() { Account account = new Account(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE); Mockito.doReturn(Mockito.mock(AccountManagerFuture.class)).when(accountManager).updateCredentials(account, AUTH_TOKEN_TYPE, null, null, null, null); AccountManagerFuture<Bundle> reAuthenticationFuture = AccountHelper.reAuthenticateUserAfterSessionExpired(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE, AUTH_TOKEN_TYPE); Assert.assertNotNull(reAuthenticationFuture); Mockito.verify(accountManager).updateCredentials(account, AUTH_TOKEN_TYPE, null, null, null, null); } |
### Question:
RecyclerViewPaginatedAdapter extends RecyclerViewCursorAdapter { @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == RecyclerViewCursorAdapter.Type.FOOTER.ordinal()) { return listItemProvider.createFooterHolder(parent); } else { return listItemProvider.createViewHolder(parent); } } RecyclerViewPaginatedAdapter(Cursor cursor,
RecyclerViewProvider<RecyclerView.ViewHolder>
listItemProvider, CommonRepository
commonRepository); @NonNull @Override RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType); @Override void onBindViewHolder(RecyclerView.ViewHolder viewHolder, Cursor cursor); boolean hasNextPage(); boolean hasPreviousPage(); void nextPageOffset(); void previousPageOffset(); void setTotalcount(int totalcount); int getTotalcount(); void setCurrentoffset(int currentoffset); int getCurrentoffset(); void setCurrentlimit(int currentlimit); int getCurrentlimit(); public int totalcount; public int currentlimit; public int currentoffset; }### Answer:
@Test public void testOnCreateViewHolder() { LinearLayout vg = new LinearLayout(context); when(listItemProvider.createViewHolder(any())).thenReturn(mockViewHolder); RecyclerView.ViewHolder actualViewHolder = adapter.onCreateViewHolder(vg, RecyclerViewCursorAdapter.Type.ITEM.ordinal()); assertNotNull(actualViewHolder); verify(listItemProvider).createViewHolder(any()); }
@Test public void testOnCreateFooterHolder() { LinearLayout vg = new LinearLayout(context); when(listItemProvider.createFooterHolder(any())).thenReturn(mockViewHolder); RecyclerView.ViewHolder actualViewHolder = adapter.onCreateViewHolder(vg, RecyclerViewCursorAdapter.Type.FOOTER.ordinal()); assertNotNull(actualViewHolder); verify(listItemProvider).createFooterHolder(any()); } |
### Question:
RecyclerViewPaginatedAdapter extends RecyclerViewCursorAdapter { @Override public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, Cursor cursor) { if (listItemProvider.isFooterViewHolder(viewHolder)) { listItemProvider.getFooterView(viewHolder, getCurrentPageCount(), getTotalPageCount(), hasNextPage(), hasPreviousPage()); } else { CommonPersonObject personinlist = commonRepository.readAllcommonforCursorAdapter(cursor); CommonPersonObjectClient pClient = new CommonPersonObjectClient(personinlist.getCaseId(), personinlist.getDetails(), personinlist.getDetails().get("FWHOHFNAME")); pClient.setColumnmaps(personinlist.getColumnmaps()); listItemProvider.getView(cursor, pClient, viewHolder); } } RecyclerViewPaginatedAdapter(Cursor cursor,
RecyclerViewProvider<RecyclerView.ViewHolder>
listItemProvider, CommonRepository
commonRepository); @NonNull @Override RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType); @Override void onBindViewHolder(RecyclerView.ViewHolder viewHolder, Cursor cursor); boolean hasNextPage(); boolean hasPreviousPage(); void nextPageOffset(); void previousPageOffset(); void setTotalcount(int totalcount); int getTotalcount(); void setCurrentoffset(int currentoffset); int getCurrentoffset(); void setCurrentlimit(int currentlimit); int getCurrentlimit(); public int totalcount; public int currentlimit; public int currentoffset; }### Answer:
@Test public void testOnBindViewHolder() { String name = "John"; Map<String, String> details = new HashMap<>(); details.put("FWHOHFNAME", name); Map<String, String> columnmaps = new HashMap<>(); String idColumn = "baseEntityId"; columnmaps.put("id", idColumn); String caseId = "case 1"; String relationId = "identifier 123"; String type = "bindtype"; CommonPersonObject personInList = new CommonPersonObject(caseId, relationId, details,type); personInList.setColumnmaps(columnmaps); when(commonRepository.readAllcommonforCursorAdapter(mCursor)).thenReturn(personInList); adapter.onBindViewHolder(mockViewHolder, mCursor); verify(listItemProvider).getView(cursorArgumentCaptor.capture(), personObjectClientArgumentCaptor.capture(), viewHolderArgumentCaptor.capture()); assertEquals(mockViewHolder, viewHolderArgumentCaptor.getValue()); assertEquals(mCursor, cursorArgumentCaptor.getValue()); assertEquals(name, personObjectClientArgumentCaptor.getValue().getName()); assertEquals(caseId, personObjectClientArgumentCaptor.getValue().getCaseId()); assertEquals(idColumn, personObjectClientArgumentCaptor.getValue().getColumnmaps().get("id")); } |
### Question:
AllFormVersionSyncService { public DownloadStatus downloadAllPendingFormFromServer() { DownloadStatus status = DownloadStatus.nothingDownloaded; List<FormDefinitionVersion> pendingFormList = formsVersionRepository. getAllFormWithSyncStatus(SyncStatus.PENDING); if (pendingFormList.isEmpty()) { return status; } else { for (FormDefinitionVersion l : pendingFormList) { String downloadLink = configuration.dristhiBaseURL() + AllConstants.FORM_DOWNLOAD_URL + l .getFormDirName(); status = httpAgent.downloadFromUrl(downloadLink, l.getFormDirName() + ".zip"); if (status == DownloadStatus.downloaded) { formsVersionRepository.updateSyncStatus(l.getFormDirName(), SyncStatus.SYNCED); } } } return status; } AllFormVersionSyncService(HTTPAgent httpAgentArg, DristhiConfiguration
configurationArg, FormsVersionRepository formsVersionRepositoryArg); FetchStatus pullFormDefinitionFromServer(); DownloadStatus downloadAllPendingFormFromServer(); void unzipAllDownloadedFormFile(); void verifyFormsInFolder(); }### Answer:
@Test public void shouldNotDownloadIfThereIsNoPendingForms() throws Exception { Mockito.when(formsVersionRepository.getAllFormWithSyncStatus(SyncStatus.PENDING)).thenReturn( Collections.<FormDefinitionVersion>emptyList()); DownloadStatus status = service.downloadAllPendingFormFromServer(); Assert.assertEquals(status, DownloadStatus.nothingDownloaded); Mockito.verify(formsVersionRepository).getAllFormWithSyncStatus(SyncStatus.PENDING); Mockito.verifyNoMoreInteractions(formsVersionRepository); Mockito.verifyZeroInteractions(httpAgent); }
@Test public void shouldDownloadIfThereIsAPendingForms() throws Exception { Mockito.when(formsVersionRepository.getAllFormWithSyncStatus(SyncStatus.PENDING)).thenReturn( this.expectedFormDefinitionVersion); Mockito.when(httpAgent.downloadFromUrl("http: "ec_dir.zip")).thenReturn(DownloadStatus.downloaded); DownloadStatus status = service.downloadAllPendingFormFromServer(); Assert.assertEquals(status, DownloadStatus.downloaded); Mockito.verify(formsVersionRepository).getAllFormWithSyncStatus(SyncStatus.PENDING); Mockito.verify(httpAgent).downloadFromUrl( "http: "ec_dir.zip"); } |
### Question:
EligibleCoupleService { public void register(FormSubmission submission) { if (isNotBlank(submission.getFieldValue(AllConstants.CommonFormFields.SUBMISSION_DATE))) { allTimelineEvents.add(TimelineEvent.forECRegistered(submission.entityId(), submission.getFieldValue(AllConstants.CommonFormFields.SUBMISSION_DATE))); } } EligibleCoupleService(AllEligibleCouples allEligibleCouples, AllTimelineEvents
allTimelineEvents, AllBeneficiaries allBeneficiaries); void register(FormSubmission submission); void fpComplications(FormSubmission submission); void fpChange(FormSubmission submission); void renewFPProduct(FormSubmission submission); void closeEligibleCouple(FormSubmission submission); }### Answer:
@Test public void shouldCreateTimelineEventWhenECIsRegistered() throws Exception { FormSubmission submission = Mockito.mock(FormSubmission.class); Mockito.when(submission.entityId()).thenReturn("entity id 1"); Mockito.when(submission.getFieldValue("submissionDate")).thenReturn("2012-01-01"); service.register(submission); Mockito.verify(allTimelineEvents).add(TimelineEvent.forECRegistered("entity id 1", "2012-01-01")); }
@Test public void shouldNotCreateTimelineEventWhenECIsRegisteredWithoutSubmissionDate() throws Exception { FormSubmission submission = Mockito.mock(FormSubmission.class); Mockito.when(submission.entityId()).thenReturn("entity id 1"); Mockito.when(submission.getFieldValue("submissionDate")).thenReturn(null); service.register(submission); Mockito.verifyZeroInteractions(allTimelineEvents); } |
### Question:
EligibleCoupleService { public void closeEligibleCouple(FormSubmission submission) { allEligibleCouples.close(submission.entityId()); allBeneficiaries.closeAllMothersForEC(submission.entityId()); } EligibleCoupleService(AllEligibleCouples allEligibleCouples, AllTimelineEvents
allTimelineEvents, AllBeneficiaries allBeneficiaries); void register(FormSubmission submission); void fpComplications(FormSubmission submission); void fpChange(FormSubmission submission); void renewFPProduct(FormSubmission submission); void closeEligibleCouple(FormSubmission submission); }### Answer:
@Test public void shouldCloseEC() throws Exception { FormSubmission submission = Mockito.mock(FormSubmission.class); Mockito.when(submission.entityId()).thenReturn("entity id 1"); service.closeEligibleCouple(submission); Mockito.verify(allEligibleCouples).close("entity id 1"); Mockito.verify(allBeneficiaries).closeAllMothersForEC("entity id 1"); } |
### Question:
EligibleCoupleService { public void fpChange(FormSubmission submission) { String fpMethodChangeDate = submission.getFieldValue( AllConstants.ECRegistrationFields.FAMILY_PLANNING_METHOD_CHANGE_DATE); if (isBlank(fpMethodChangeDate)) { fpMethodChangeDate = submission .getFieldValue(AllConstants.CommonFormFields.SUBMISSION_DATE); } allTimelineEvents.add(forChangeOfFPMethod(submission.entityId(), submission.getFieldValue(AllConstants.ECRegistrationFields.CURRENT_FP_METHOD), submission.getFieldValue(NEW_FP_METHOD_FIELD_NAME), fpMethodChangeDate)); allEligibleCouples.mergeDetails(submission.entityId(), mapOf(AllConstants.ECRegistrationFields.CURRENT_FP_METHOD, submission.getFieldValue(NEW_FP_METHOD_FIELD_NAME))); } EligibleCoupleService(AllEligibleCouples allEligibleCouples, AllTimelineEvents
allTimelineEvents, AllBeneficiaries allBeneficiaries); void register(FormSubmission submission); void fpComplications(FormSubmission submission); void fpChange(FormSubmission submission); void renewFPProduct(FormSubmission submission); void closeEligibleCouple(FormSubmission submission); }### Answer:
@Test public void shouldCreateTimelineEventAndUpdateEntityWhenFPChangeIsReported() throws Exception { FormSubmission submission = Mockito.mock(FormSubmission.class); Mockito.when(submission.entityId()).thenReturn("entity id 1"); Mockito.when(submission.getFieldValue("currentMethod")).thenReturn("condom"); Mockito.when(submission.getFieldValue("newMethod")).thenReturn("ocp"); Mockito.when(submission.getFieldValue("familyPlanningMethodChangeDate")).thenReturn("2012-01-01"); service.fpChange(submission); Mockito.verify(allTimelineEvents).add(TimelineEvent.forChangeOfFPMethod("entity id 1", "condom", "ocp", "2012-01-01")); Mockito.verify(allEligibleCouples).mergeDetails("entity id 1", EasyMap.mapOf("currentMethod", "ocp")); }
@Test public void shouldUseFormSubmissionDateAsChangeDateWhenFPMethodIsChangedAndChangeDateIsBlank() throws Exception { FormSubmission submission = Mockito.mock(FormSubmission.class); Mockito.when(submission.entityId()).thenReturn("entity id 1"); Mockito.when(submission.getFieldValue("currentMethod")).thenReturn("condom"); Mockito.when(submission.getFieldValue("newMethod")).thenReturn("none"); Mockito.when(submission.getFieldValue("submissionDate")).thenReturn("2012-02-01"); service.fpChange(submission); Mockito.verify(allTimelineEvents).add(TimelineEvent.forChangeOfFPMethod("entity id 1", "condom", "none", "2012-02-01")); Mockito.verify(allEligibleCouples).mergeDetails("entity id 1", EasyMap.mapOf("currentMethod", "none")); } |
### Question:
DocumentConfigurationService { protected Manifest convertManifestDTOToManifest(ManifestDTO manifestDTO) throws JSONException { Manifest manifest = new Manifest(); manifest.setVersion(manifestDTO.getIdentifier()); manifest.setAppVersion(manifestDTO.getAppVersion()); manifest.setCreatedAt(manifestDTO.getCreatedAt()); JSONObject json = new JSONObject(manifestDTO.getJson()); if (json.has(MANIFEST_FORMS_VERSION)) { manifest.setFormVersion(json.getString(MANIFEST_FORMS_VERSION)); } if (json.has(IDENTIFIERS)) { List<String> identifiers = new Gson().fromJson(json.getJSONArray(IDENTIFIERS).toString(), new TypeToken<List<String>>() { }.getType()); manifest.setIdentifiers(identifiers); } return manifest; } DocumentConfigurationService(HTTPAgent httpAgentArg, ManifestRepository manifestRepositoryArg, ClientFormRepository clientFormRepositoryArg, DristhiConfiguration
configurationArg); void fetchManifest(); static final String MANIFEST_FORMS_VERSION; static final String FORM_VERSION; static final String CURRENT_FORM_VERSION; static final String IDENTIFIERS; }### Answer:
@Test public void convertManifestDTOToManifest() throws JSONException { String manifestDTOJson = "{\"json\":\"{\\\"forms_version\\\":\\\"0.0.1\\\",\\\"identifiers\\\":[\\\"anc/member_registration.json\\\",\\\"anc/pregnancy_outcome.json\\\"]}\",\"appId\":\"org.smartregister.chw\",\"appVersion\":\"0.0.1\",\"id\":1}"; ManifestDTO manifestDTO = new Gson().fromJson(manifestDTOJson, ManifestDTO.class); Manifest manifest; manifest = documentConfigurationService.convertManifestDTOToManifest(manifestDTO); Assert.assertEquals(manifest.getAppVersion(), manifestDTO.getAppVersion()); Assert.assertEquals(manifest.getCreatedAt(), manifestDTO.getCreatedAt()); JSONObject json = new JSONObject(manifestDTO.getJson()); Assert.assertEquals(manifest.getFormVersion(), json.getString(MANIFEST_FORMS_VERSION)); Assert.assertEquals(manifest.getIdentifiers(), new Gson().fromJson(json.getString(IDENTIFIERS), new TypeToken<List<String>>() { }.getType())); } |
### Question:
DocumentConfigurationService { @VisibleForTesting protected void saveManifestVersion(@NonNull String manifestVersion) { boolean manifestVersionSaved = CoreLibrary.getInstance() .context() .allSharedPreferences() .saveManifestVersion(manifestVersion); if (!manifestVersionSaved) { Timber.e(new Exception("Saving manifest version failed")); } } DocumentConfigurationService(HTTPAgent httpAgentArg, ManifestRepository manifestRepositoryArg, ClientFormRepository clientFormRepositoryArg, DristhiConfiguration
configurationArg); void fetchManifest(); static final String MANIFEST_FORMS_VERSION; static final String FORM_VERSION; static final String CURRENT_FORM_VERSION; static final String IDENTIFIERS; }### Answer:
@Test public void saveManifestVersionShouldSaveVersionInSharedPreferences() { Assert.assertNull(CoreLibrary.getInstance().context().allSharedPreferences().fetchManifestVersion()); String manifestVersion = "0.0.89"; documentConfigurationService.saveManifestVersion(manifestVersion); Assert.assertEquals(manifestVersion, CoreLibrary.getInstance().context().allSharedPreferences().fetchManifestVersion()); } |
### Question:
AppProperties extends Properties { public Boolean getPropertyBoolean(String key) { return Boolean.valueOf(getProperty(key)); } Boolean getPropertyBoolean(String key); Boolean hasProperty(String key); Boolean isTrue(String key); }### Answer:
@Test public void testGetPropertyBooleanReturnsCorrectValue() { AppProperties properties = new AppProperties(); Boolean value = properties.getPropertyBoolean(PROP_KEY); Assert.assertNotNull(value); Assert.assertFalse(value); properties.setProperty(PROP_KEY, TEST_VAL_TRUE); value = properties.getPropertyBoolean(PROP_KEY); Assert.assertNotNull(value); Assert.assertTrue(value); } |
### Question:
AppProperties extends Properties { public Boolean hasProperty(String key) { return getProperty(key) != null; } Boolean getPropertyBoolean(String key); Boolean hasProperty(String key); Boolean isTrue(String key); }### Answer:
@Test public void testHasPropertyReturnsCorrectValue() { AppProperties properties = new AppProperties(); Boolean value = properties.hasProperty(PROP_KEY); Assert.assertNotNull(value); Assert.assertFalse(value); properties.setProperty(PROP_KEY, TEST_VAL); value = properties.hasProperty(PROP_KEY); Assert.assertNotNull(value); Assert.assertTrue(value); } |
### Question:
FloatUtil { public static Float tryParse(String value, Float defaultValue) { try { return Float.parseFloat(value); } catch (NumberFormatException e) { return defaultValue; } } static Float tryParse(String value, Float defaultValue); static String tryParse(String value, String defaultValue); }### Answer:
@Test public void assertTryParseWithInvalidValue() { Assert.assertEquals(FloatUtil.tryParse("invalid", 1.0f), 1.0f); Assert.assertEquals(FloatUtil.tryParse("invalid", "1"), "1"); }
@Test public void assertTryParseWithValidValue() { Assert.assertEquals(FloatUtil.tryParse("1", 1.0f), 1.0f); Assert.assertEquals(FloatUtil.tryParse("1", "1"), "1.0"); } |
### Question:
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String
newCharacter); static String replaceAndHumanizeWithInitCapText(String value, String oldCharacter,
String newCharacter); static String humanizeAndDoUPPERCASE(String value); static String humanizeAndUppercase(String value, String... skipTokens); static String getValue(String value); }### Answer:
@Test public void assertShouldCapitalize() throws Exception { org.junit.Assert.assertEquals("Abc", org.smartregister.util.StringUtil.humanize("abc")); org.junit.Assert.assertEquals("Abc", org.smartregister.util.StringUtil.humanize("Abc")); }
@Test public void shouldReplaceUnderscoreWithSpace() throws Exception { org.junit.Assert.assertEquals("Abc def", org.smartregister.util.StringUtil.humanize("abc_def")); org.junit.Assert.assertEquals("Abc def", org.smartregister.util.StringUtil.humanize("Abc_def")); }
@Test public void assertShouldHandleEmptyAndNull() throws Exception { org.junit.Assert.assertEquals("", org.smartregister.util.StringUtil.humanize("")); } |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.