Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rajkiran20 committed Mar 28, 2020
1 parent dba75b8 commit deccfac
Show file tree
Hide file tree
Showing 30 changed files with 62 additions and 149 deletions.
3 changes: 2 additions & 1 deletion addons/logger/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dependancies.*
import dependancies.Deps
import dependancies.Modules

apply from: rootProject.file("android-library-commons.gradle")

Expand Down
3 changes: 1 addition & 2 deletions addons/logger/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.skeleton.logger" />
<manifest package="com.skeleton.logger" />
2 changes: 1 addition & 1 deletion android-commons.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dependancies.*
import dependancies.Deps

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
Expand Down
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dependancies.*
import dependancies.Deps
import dependancies.Modules

apply plugin: 'com.android.application'
apply from: rootProject.file("android-commons.gradle")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.skeleton.location.ui.fragment

import com.skeleton.R

import com.skeleton.R.id.tv_requested_date
import com.skeleton.ui.activity.TestsOnlyActivity
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.filters.LargeTest
import androidx.test.runner.AndroidJUnit4
import br.com.concretesolutions.kappuccino.assertions.VisibilityAssertions.displayed
import com.skeleton.R
import com.skeleton.R.id.tv_requested_date
import com.skeleton.ui.activity.TestsOnlyActivity
import org.junit.Before
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package com.skeleton.location.ui.fragment

import com.skeleton.R
import com.skeleton.R.id.tv_requested_date
import com.skeleton.location.R.id.*
import com.skeleton.testUtil.MockServerDispatcher
import com.skeleton.ui.activity.TestsOnlyActivity
import androidx.test.espresso.Espresso.onData
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withSpinnerText
import androidx.test.filters.LargeTest
import androidx.test.runner.AndroidJUnit4
import br.com.concretesolutions.kappuccino.actions.ClickActions.click
import br.com.concretesolutions.kappuccino.assertions.VisibilityAssertions.displayed
import br.com.concretesolutions.kappuccino.custom.recyclerView.RecyclerViewInteractions.recyclerView
import com.skeleton.R
import com.skeleton.R.id.tv_requested_date
import com.skeleton.testUtil.MockServerDispatcher
import com.skeleton.ui.activity.TestsOnlyActivity
import okhttp3.mockwebserver.MockWebServer
import org.hamcrest.CoreMatchers.*
import org.hamcrest.Matchers.allOf
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import br.com.concretesolutions.kappuccino.actions.ClickActions.click
import org.hamcrest.CoreMatchers.*

@LargeTest
@RunWith(AndroidJUnit4::class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
package com.skeleton.search.ui.fragment

import `in`.org.projecteka.featuresprovider.R.id.*
import com.skeleton.R
import com.skeleton.testUtil.MockServerDispatcher
import com.skeleton.ui.activity.TestsOnlyActivity
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.filters.LargeTest
import androidx.test.runner.AndroidJUnit4
import br.com.concretesolutions.kappuccino.actions.ClickActions.click
import br.com.concretesolutions.kappuccino.actions.TextActions.typeText
import br.com.concretesolutions.kappuccino.assertions.VisibilityAssertions.displayed
import br.com.concretesolutions.kappuccino.assertions.VisibilityAssertions.notDisplayed
import br.com.concretesolutions.kappuccino.custom.recyclerView.RecyclerViewInteractions.recyclerView
import com.skeleton.testUtil.MockServerDispatcher
import com.skeleton.ui.activity.TestsOnlyActivity
import okhttp3.mockwebserver.MockWebServer
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@LargeTest
Expand All @@ -37,84 +29,13 @@ class LandingFragmentTest {

webServer.dispatcher = MockServerDispatcher().RequestDispatcher(activityRule.activity.applicationContext)

val searchFragment = ProviderSearchFragment()
activityRule.activity.addFragment(searchFragment)
// val fragment = YourFragmentName()
// activityRule.activity.addFragment(searchFragment)
}

@After
@Throws(Exception::class)
fun tearDown() {
webServer.shutdown()
}

@Test
fun shouldSearchProvidersByGivenName() {
typeText("Health") { id(sv_provider) }
recyclerView(rv_search_results) {
atPosition(1) {
displayed {
id(provider_name)
text("Max Health Care, Bangalore")
}
}
}
}
}

@Test
fun shouldShowNoResultsFoundForInvalidProviderName() {
typeText("SomeInvalidProvider") { id(sv_provider) }
displayed {
id(provider_name)
text("R.string.no_results_found")
}
}

@Test
fun shouldClearProviderNameTextOnClearButtonClick() {
typeText("Some Really Long Provider Name") { id(sv_provider) }
displayed { id(iv_clear_results) }
click(true) { id(iv_clear_results) }
displayed {
id(tv_search_provider_label)
text(R.string.search_health_information_provider)
}
notDisplayed { id(iv_clear_results) }
}

@Test
fun shouldSelectTheClickedProvider() {
typeText("Health") { id(sv_provider) }
recyclerView(rv_search_results) { atPosition(1) { click() } }
displayed {
id(tv_selected_provider)
text("Max Health Care, Bangalore")
}

notDisplayed { id(iv_clear_results) }
notDisplayed { id(sv_provider) }
displayed {
id(tv_mobile_number)
text("98XXXXXX10")
}
}

@Test
fun shouldClearSelectedProviderOnProviderNameClick() {
typeText("Health") {
id(sv_provider)
}
recyclerView(rv_search_results) { atPosition(1) { click() } }
click {
allOf {
id(tv_selected_provider)
text("Max Health Care, Bangalore")
}
}
notDisplayed { id(tv_selected_provider) }
displayed { id(iv_clear_results) }
displayed {
id(sv_provider)
text("Health")
}
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/skeleton/SkeletonApp.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.skeleton

import android.app.Application
import com.skeleton.module.networkModule
import com.skeleton.module.repositoryModule
import com.skeleton.module.viewModelModule
import android.app.Application
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.loadKoinModules
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/skeleton/module/Modules.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.skeleton.module

import `in`.org.projecteka.featuresprovider.BuildConfig
import com.skeleton.BuildConfig
import com.skeleton.network.createNetworkClient
import com.skeleton.search.remote.LandingApis
import com.skeleton.search.repository.LandingRepository
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/skeleton/ui/LauncherActivity.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.skeleton.ui

import com.skeleton.R
import com.skeleton.databinding.ActivityLauncherBinding
import com.skeleton.presentation.ui.BaseActivity
import android.os.Bundle
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import com.skeleton.R
import com.skeleton.databinding.ActivityLauncherBinding
import com.skeleton.presentation.ui.BaseActivity


class LauncherActivity : BaseActivity() {
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dependancies.*
import dependancies.Config
import dependancies.Deps

buildscript {
ext.kotlin_version = '1.3.61'
Expand Down
3 changes: 2 additions & 1 deletion commons/network/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dependancies.*
import dependancies.Deps
import dependancies.Modules

apply from: rootProject.file("android-library-commons.gradle")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.skeleton.network

import com.skeleton.util.constant.NetworkConstants.Companion.MOCK_WEB_SERVER_TEST_URL
import android.app.Application
import android.content.Context
import com.skeleton.network.interceptor.HostSelectionInterceptor
import com.skeleton.network.interceptor.RequestInterceptor
import com.skeleton.util.constant.NetworkConstants.Companion.CONNECT_TIMEOUT
import com.skeleton.util.constant.NetworkConstants.Companion.MOCK_WEB_SERVER_TEST_URL
import com.skeleton.util.constant.NetworkConstants.Companion.READ_TIMEOUT
import com.skeleton.util.constant.NetworkConstants.Companion.WRITE_TIMEOUT
import com.skeleton.util.sharedPref.getAuthToken
Expand Down Expand Up @@ -61,4 +61,4 @@ private fun retrofitClient(baseUrl: String, httpClient: OkHttpClient): Retrofit
.build()
}

private fun isTestingMode(context: Application) = context.javaClass.simpleName != "JataayuApp"
private fun isTestingMode(context: Application) = context.javaClass.simpleName != "SkeletonApp"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.skeleton.network.interceptor

import android.content.Context
import com.skeleton.util.sharedPref.NetworkSharedPrefsManager
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException
Expand Down
3 changes: 2 additions & 1 deletion commons/presentation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dependancies.*
import dependancies.Deps
import dependancies.Modules

apply from: rootProject.file("android-library-commons.gradle")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.skeleton.presentation.adapter

import com.skeleton.presentation.callback.IDataBindingModel
import com.skeleton.presentation.callback.ItemClickCallback
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil.inflate
import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.RecyclerView
import com.skeleton.presentation.callback.IDataBindingModel
import com.skeleton.presentation.callback.ItemClickCallback
import java.util.*

open class GenericRecyclerViewAdapter : RecyclerView.Adapter<GenericRecyclerViewAdapter.RecyclerViewHolder> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package com.skeleton.presentation.ui

import android.content.DialogInterface
import android.os.Bundle
import android.view.KeyEvent
import android.view.MenuItem
import android.widget.RadioButton
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import com.skeleton.presentation.BuildConfig
import com.skeleton.presentation.R
import com.skeleton.presentation.databinding.NetworkPrefDialogBinding
Expand All @@ -11,14 +19,6 @@ import com.skeleton.util.sharedPref.NetworkSharedPrefsManager.Companion.getBaseU
import com.skeleton.util.sharedPref.NetworkSharedPrefsManager.Companion.getEndpointIndex
import com.skeleton.util.sharedPref.NetworkSharedPrefsManager.Companion.setAuthToken
import com.skeleton.util.sharedPref.NetworkSharedPrefsManager.Companion.setNetworkPref
import android.content.DialogInterface
import android.os.Bundle
import android.view.KeyEvent
import android.view.MenuItem
import android.widget.RadioButton
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment

abstract class BaseActivity : AppCompatActivity() {
private lateinit var networkPrefDialogBinding: NetworkPrefDialogBinding
Expand Down
2 changes: 1 addition & 1 deletion commons/presentation/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:app="http://schemas.android.com/apk/res-auto">
<resources>

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.skeleton.util.sharedPref

import com.skeleton.util.constant.NetworkConstants.Companion.PROD_URL
import android.content.Context
import androidx.core.content.edit
import com.skeleton.util.constant.NetworkConstants.Companion.PROD_URL

private const val NETWORK_PREF = "NETWORK_PREF_FILE"
private const val ENVIRONMENT = "ENVIRONMENT"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
package com.skeleton.util.extension

import com.skeleton.util.R
import com.skeleton.util.ui.activity.TestsOnlyActivity
import com.skeleton.util.ui.fragment.TestsOnlyFragment
import android.view.View
import androidx.annotation.IntegerRes
import androidx.appcompat.app.AppCompatActivity
import androidx.test.filters.LargeTest
import androidx.test.runner.AndroidJUnit4
import com.skeleton.util.R
import com.skeleton.util.ui.activity.TestsOnlyActivity
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentMatchers
import org.mockito.ArgumentMatchers.anyInt
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.Mockito.*
import org.mockito.MockitoAnnotations
import org.mockito.junit.MockitoJUnitRunner

@RunWith(MockitoJUnitRunner::class)
Expand All @@ -26,7 +18,7 @@ class ExtensionsTest {

@Before
fun setUp() {
testActivity = Mockito.mock(TestsOnlyActivity::class.java)
testActivity = mock(TestsOnlyActivity::class.java)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.skeleton.util.ui.activity

import com.skeleton.util.R
import android.os.Bundle
import android.view.WindowManager
import androidx.annotation.RestrictTo
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import com.skeleton.util.R

@RestrictTo(RestrictTo.Scope.TESTS)
open class TestsOnlyActivity : AppCompatActivity() {
Expand Down
2 changes: 1 addition & 1 deletion features/core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dependancies.Modules
import dependancies.Deps
import dependancies.Modules

apply from: rootProject.file("android-library-commons.gradle")
apply from: rootProject.file("jacoco.gradle")
Expand Down
3 changes: 1 addition & 2 deletions features/core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.skeleton.core" />
<manifest package="com.skeleton.core" />
Loading

0 comments on commit deccfac

Please sign in to comment.