This is a JUnit extension that shards the tests for parallel execution.
It selects tests by hashing the test class and method name.
Tests are sharded if these environment variables are present:
| import java.io.IOException; | |
| import okhttp3.Interceptor; | |
| import okhttp3.Response; | |
| import static okhttp3.internal.http.StatusLine.HTTP_PERM_REDIRECT; | |
| import static okhttp3.internal.http.StatusLine.HTTP_TEMP_REDIRECT; | |
| /** | |
| * In OkHttp 4.5 and earlier, HTTP 307 and 308 redirects were only honored if the request method | |
| * was GET or HEAD. |
| /* | |
| * Copyright (C) 2020 Square, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| import java.math.BigInteger | |
| interface Fibonacci { | |
| fun fib(n: Int): Int | |
| } | |
| object LawfulGood : Fibonacci { | |
| override fun fib(n: Int): Int { | |
| check(n >= 0) { "fib is undefined for negative values: $n" } | |
| return when (n) { |
| /* | |
| * Copyright (C) 2009 The Guava Authors | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| /* | |
| * Copyright (C) 2014 Square, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| import okhttp3.ResponseBody | |
| import okhttp3.mockwebserver.MockResponse | |
| import okhttp3.mockwebserver.MockWebServer | |
| import okio.ByteString | |
| import okio.ByteString.Companion.encodeUtf8 | |
| import org.assertj.core.api.Assertions.assertThat | |
| import org.junit.Rule | |
| import org.junit.Test | |
| import retrofit2.Call | |
| import retrofit2.Converter |
| // JAVA DECOMPILED | |
| // | |
| // Source code recreated from a .class file by IntelliJ IDEA | |
| // (powered by Fernflower decompiler) | |
| // | |
| package okhttp3; | |
| import java.nio.charset.Charset; | |
| import java.nio.charset.StandardCharsets; |
| package org.junit; | |
| import static org.assertj.core.api.Assertions.assertThat; | |
| import static org.assertj.core.data.Offset.offset; | |
| public class Assert { | |
| public static void assertTrue(String message, boolean condition) { | |
| assertThat(condition).overridingErrorMessage(message).isTrue(); | |
| } |