Skip to content

Commit

Permalink
Refactored code.| #2162
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed Feb 27, 2023
1 parent 375b93b commit 2769842
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import com.flowcrypt.email.api.retrofit.response.api.ClientConfigurationResponse
import com.flowcrypt.email.api.retrofit.response.api.FesServerResponse
import com.flowcrypt.email.api.retrofit.response.base.ApiError
import com.flowcrypt.email.api.retrofit.response.model.ClientConfiguration
import com.flowcrypt.email.extensions.kotlin.urlDecoded
import com.flowcrypt.email.extensions.org.bouncycastle.openpgp.toPgpKeyDetails
import com.flowcrypt.email.rules.ClearAppSettingsRule
import com.flowcrypt.email.rules.FlowCryptMockWebServerRule
Expand Down Expand Up @@ -174,8 +173,7 @@ class SubmitPublicKeyToAttesterForImportedKeyDuringSetupFlowTest : BaseSignTest(
request.path == "api" -> MockResponse().setResponseCode(HttpURLConnection.HTTP_OK)
.setBody(gson.toJson(FES_SUCCESS_RESPONSE))

request.path?.urlDecoded()
.equals("/shared-tenant-fes/api/v1/client-configuration?domain=flowcrypt.test") -> {
request.path.equals("/shared-tenant-fes/api/v1/client-configuration?domain=flowcrypt.test") -> {
MockResponse().setResponseCode(HttpURLConnection.HTTP_OK)
.setBody(gson.toJson(CLIENT_CONFIGURATION_RESPONSE))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import com.flowcrypt.email.TestConstants
import com.flowcrypt.email.api.retrofit.ApiHelper
import com.flowcrypt.email.api.retrofit.response.api.ClientConfigurationResponse
import com.flowcrypt.email.api.retrofit.response.model.ClientConfiguration
import com.flowcrypt.email.extensions.kotlin.urlDecoded
import com.flowcrypt.email.junit.annotations.NotReadyForCI
import com.flowcrypt.email.rules.AddAccountToDatabaseRule
import com.flowcrypt.email.rules.ClearAppSettingsRule
Expand Down Expand Up @@ -81,9 +80,7 @@ class AddNewAccountEnterpriseTest : BaseSignTest() {
val gson =
ApiHelper.getInstance(InstrumentationRegistry.getInstrumentation().targetContext).gson

if (request.path?.urlDecoded()
.equals("/api/v1/client-configuration?domain=localhost:1212")
) {
if (request.path.equals("/api/v1/client-configuration?domain=flowcrypt.test")) {
when (extractEmailFromRecordedRequest(request)) {
EMAIL_WITH_NO_PRV_CREATE_RULE -> return MockResponse().setResponseCode(
HttpURLConnection.HTTP_OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ import androidx.work.WorkerParameters
import com.flowcrypt.email.R
import com.flowcrypt.email.api.email.EmailUtil
import com.flowcrypt.email.api.email.JavaEmailConstants
import com.flowcrypt.email.api.retrofit.ApiClientRepository
import com.flowcrypt.email.api.email.javamail.PasswordProtectedAttachmentInfoDataSource
import com.flowcrypt.email.api.retrofit.FlowcryptApiRepository
import com.flowcrypt.email.api.retrofit.ApiClientRepository
import com.flowcrypt.email.api.retrofit.request.model.MessageUploadRequest
import com.flowcrypt.email.database.MessageState
import com.flowcrypt.email.database.entity.AccountEntity
Expand Down

0 comments on commit 2769842

Please sign in to comment.