Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for NewClient (0.05 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

    import org.junit.jupiter.api.extension.ExtensionContext
    
    /**
     * Apply this rule to all tests. It adds additional checks for leaked resources and uncaught
     * exceptions.
     *
     * Use [newClient] as a factory for a OkHttpClient instances. These instances are specifically
     * configured for testing.
     */
    class OkHttpClientTestRule :
      BeforeEachCallback,
      AfterEachCallback {
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 10.8K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/java/okhttp3/CallJavaTest.java

    import static org.junit.jupiter.api.Assertions.assertEquals;
    
    public class CallJavaTest {
      @RegisterExtension
      OkHttpClientTestRule clientTestRule = new OkHttpClientTestRule();
    
      private OkHttpClient client = clientTestRule.newClient();
    
      @Test
      public void tagsSeededFromRequest() {
        Request request = new Request.Builder()
          .url(HttpUrl.get("https://square.com/"))
          .tag(Integer.class, 5)
          .tag(String.class, "hello")
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sun Oct 26 14:54:46 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  3. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourcesHttpTest.kt

      @StartStop
      private val server = MockWebServer()
    
      @RegisterExtension
      val clientTestRule = OkHttpClientTestRule()
    
      private val listener = EventSourceRecorder()
      private val client = clientTestRule.newClient()
    
      @AfterEach
      fun after() {
        listener.assertExhausted()
      }
    
      @Test
      fun processResponse() {
        server.enqueue(
          MockResponse
            .Builder()
            .body(
              """
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Oct 03 07:51:20 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/CallTagsTest.kt

    import org.junit.jupiter.api.extension.RegisterExtension
    
    class CallTagsTest {
      @JvmField @RegisterExtension
      val clientTestRule = OkHttpClientTestRule()
    
      private var client = clientTestRule.newClient()
    
      @Test
      fun tagsSeededFromRequest() {
        val request =
          Request
            .Builder()
            .url("https://square.com/".toHttpUrl())
            .tag(Integer::class, 5 as Integer)
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sun Oct 26 14:54:46 UTC 2025
    - 2.8K bytes
    - Viewed (0)
  5. internal/event/target/kafka_scram_client_contrib.go

    // and authzID via the SASLprep algorithm, as recommended by RFC-5802.  If
    // SASLprep fails, the method returns an error.
    func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error) {
    	x.Client, err = x.NewClient(userName, password, authzID)
    	if err != nil {
    		return err
    	}
    	x.ClientConversation = x.NewConversation()
    	return nil
    }
    
    // Step takes a string provided from a server (or just an empty string for the
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  6. internal/logger/target/kafka/kafka_scram_client_contrib.go

    // and authzID via the SASLprep algorithm, as recommended by RFC-5802.  If
    // SASLprep fails, the method returns an error.
    func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error) {
    	x.Client, err = x.NewClient(userName, password, authzID)
    	if err != nil {
    		return err
    	}
    	x.ClientConversation = x.NewConversation()
    	return nil
    }
    
    // Step takes a string provided from a server (or just an empty string for the
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/SessionReuseTest.kt

      @JvmField @RegisterExtension
      val clientTestRule = OkHttpClientTestRule()
    
      private val handshakeCertificates = platform.localhostHandshakeCertificates()
    
      var client = clientTestRule.newClient()
    
      @StartStop
      private val server = MockWebServer()
    
      @BeforeEach
      fun setUp() {
        // Default after JDK 14, but we are avoiding tests that assume special setup.
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Nov 01 12:18:11 UTC 2025
    - 5.9K bytes
    - Viewed (1)
  8. internal/rest/client.go

    }
    
    // Close closes all idle connections of the underlying http client
    func (c *Client) Close() {
    	atomic.StoreInt32(&c.connected, closed)
    }
    
    // NewClient - returns new REST client.
    func NewClient(uu *url.URL, tr http.RoundTripper, auth func() string) *Client {
    	connected := int32(online)
    	urlStr := uu.String()
    	u, err := url.Parse(urlStr)
    	if err != nil {
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 14.7K bytes
    - Viewed (0)
  9. internal/dsync/dsync_test.go

    // TestMain initializes the testing framework
    func TestMain(m *testing.M) {
    	startLockServers()
    
    	// Initialize locker clients for dsync.
    	var clnts []NetLocker
    	for i := range nodes {
    		clnts = append(clnts, newClient(nodes[i].URL))
    	}
    
    	ds = &Dsync{
    		GetLockers: func() ([]NetLocker, string) { return clnts, uuid.New().String() },
    		Timeouts: Timeouts{
    			Acquire:         testDrwMutexAcquireTimeout,
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 10.8K bytes
    - Viewed (0)
  10. cmd/storage-rest-client.go

    		Host:   endpoint.Host,
    		Path:   path.Join(storageRESTPrefix, endpoint.Path, storageRESTVersion),
    	}
    
    	restClient := rest.NewClient(serverURL, globalInternodeTransport, newCachedAuthToken())
    	if healthCheck {
    		// Use a separate client to avoid recursive calls.
    		healthClient := rest.NewClient(serverURL, globalInternodeTransport, newCachedAuthToken())
    		healthClient.NoMetrics = true
    		restClient.HealthCheckFn = func() bool {
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 08 02:38:41 UTC 2025
    - 30.4K bytes
    - Viewed (0)
Back to top