Skip to content

Commit

Permalink
ODP for client only removed
Browse files Browse the repository at this point in the history
  • Loading branch information
muzahidul-opti committed Aug 23, 2024
1 parent f713de9 commit f985a79
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package com.optimizely.ab.android.odp

import androidx.test.ext.junit.runners.AndroidJUnit4
import com.optimizely.ab.android.shared.ClientForODPOnly
import com.optimizely.ab.android.shared.Client
import java.io.OutputStream
import java.net.HttpURLConnection
import org.junit.Assert.assertNull
Expand All @@ -34,9 +34,9 @@ import org.slf4j.Logger
@RunWith(AndroidJUnit4::class)
class ODPSegmentClientTest {
private val logger = mock(Logger::class.java)
private val client = mock(ClientForODPOnly::class.java)
private val client = mock(Client::class.java)
private val urlConnection = mock(HttpURLConnection::class.java)
private val captor = ArgumentCaptor.forClass(ClientForODPOnly.Request::class.java)
private val captor = ArgumentCaptor.forClass(Client.Request::class.java)
private lateinit var segmentClient: ODPSegmentClient

private val apiKey = "valid-key"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package com.optimizely.ab.android.odp

import android.content.Context
import androidx.annotation.VisibleForTesting
import com.optimizely.ab.android.shared.ClientForODPOnly
import com.optimizely.ab.android.shared.Client
import com.optimizely.ab.android.shared.OptlyStorage
import com.optimizely.ab.android.shared.WorkerScheduler
import com.optimizely.ab.odp.ODPApiManager
Expand All @@ -33,7 +33,7 @@ open class DefaultODPApiManager(private val context: Context, timeoutForSegmentF

@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
var segmentClient = ODPSegmentClient(
ClientForODPOnly(OptlyStorage(context), LoggerFactory.getLogger(ClientForODPOnly::class.java)),
Client(OptlyStorage(context), LoggerFactory.getLogger(Client::class.java)),
LoggerFactory.getLogger(ODPSegmentClient::class.java)
)
private val logger = LoggerFactory.getLogger(DefaultODPApiManager::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
package com.optimizely.ab.android.odp

import androidx.annotation.VisibleForTesting
import com.optimizely.ab.android.shared.ClientForODPOnly
import com.optimizely.ab.android.shared.Client
import com.optimizely.ab.odp.parser.ResponseJsonParser
import com.optimizely.ab.odp.parser.ResponseJsonParserFactory
import org.slf4j.Logger
import java.net.HttpURLConnection
import java.net.URL

@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
open class ODPSegmentClient(private val client: ClientForODPOnly, private val logger: Logger) {
open class ODPSegmentClient(private val client: Client, private val logger: Logger) {

@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
open fun fetchQualifiedSegments(
Expand All @@ -32,7 +32,7 @@ open class ODPSegmentClient(private val client: ClientForODPOnly, private val lo
payload: String
): List<String>? {

val request: ClientForODPOnly.Request<String> = ClientForODPOnly.Request {
val request: Client.Request<String> = Client.Request {
var urlConnection: HttpURLConnection? = null
try {
val url = URL(apiEndpoint)
Expand Down

This file was deleted.

0 comments on commit f985a79

Please sign in to comment.