Skip to content

Commit ab038ab

Browse files
committed
(#360) - Qulice update
1 parent a02e2a1 commit ab038ab

29 files changed

+42
-52
lines changed

src/main/java/com/jcabi/http/wire/AutoRedirectingWire.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
package com.jcabi.http.wire;
3131

3232
import com.jcabi.aspects.Immutable;
33-
import com.jcabi.aspects.Tv;
3433
import com.jcabi.http.Request;
3534
import com.jcabi.http.Response;
3635
import com.jcabi.http.Wire;
@@ -86,7 +85,7 @@ public final class AutoRedirectingWire implements Wire {
8685
* @param wire Original wire
8786
*/
8887
public AutoRedirectingWire(final Wire wire) {
89-
this(wire, Tv.FIVE);
88+
this(wire, 5);
9089
}
9190

9291
/**

src/main/java/com/jcabi/http/wire/CachingWire.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.google.common.cache.CacheLoader;
3434
import com.google.common.cache.LoadingCache;
3535
import com.jcabi.aspects.Immutable;
36-
import com.jcabi.aspects.Tv;
3736
import com.jcabi.http.Request;
3837
import com.jcabi.http.Response;
3938
import com.jcabi.http.Wire;
@@ -204,7 +203,7 @@ public Response send(
204203
final int read
205204
) throws IOException {
206205
final URI uri = req.uri().get();
207-
final StringBuilder label = new StringBuilder(Tv.HUNDRED)
206+
final StringBuilder label = new StringBuilder(100)
208207
.append(method).append(' ').append(uri.getPath());
209208
if (uri.getQuery() != null) {
210209
label.append('?').append(uri.getQuery());

src/main/java/com/jcabi/http/wire/FcWire.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
package com.jcabi.http.wire;
3131

3232
import com.jcabi.aspects.Immutable;
33-
import com.jcabi.aspects.Tv;
3433
import com.jcabi.http.Request;
3534
import com.jcabi.http.Response;
3635
import com.jcabi.http.Wire;
@@ -138,7 +137,7 @@ public Response send(final Request req, final String home,
138137
final int connect,
139138
final int read) throws IOException {
140139
final URI uri = req.uri().get();
141-
final StringBuilder label = new StringBuilder(Tv.HUNDRED)
140+
final StringBuilder label = new StringBuilder(100)
142141
.append(method).append(' ').append(uri.getPath());
143142
if (uri.getQuery() != null) {
144143
label.append('?').append(uri.getQuery());

src/main/java/com/jcabi/http/wire/RetryWire.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
package com.jcabi.http.wire;
3131

3232
import com.jcabi.aspects.Immutable;
33-
import com.jcabi.aspects.Tv;
3433
import com.jcabi.http.Request;
3534
import com.jcabi.http.Response;
3635
import com.jcabi.http.Wire;
@@ -91,7 +90,7 @@ public Response send(final Request req, final String home,
9190
final int connect, final int read) throws IOException {
9291
int attempt = 0;
9392
while (true) {
94-
if (attempt > Tv.THREE) {
93+
if (attempt > 3) {
9594
throw new IOException(
9695
String.format("failed after %d attempts", attempt)
9796
);

src/main/java/com/jcabi/http/wire/VerboseWire.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
package com.jcabi.http.wire;
3131

3232
import com.jcabi.aspects.Immutable;
33-
import com.jcabi.aspects.Tv;
3433
import com.jcabi.http.Request;
3534
import com.jcabi.http.RequestBody;
3635
import com.jcabi.http.Response;
@@ -88,7 +87,7 @@ public Response send(final Request req, final String home,
8887
final int connect,
8988
final int read) throws IOException {
9089
final ByteArrayOutputStream output = new ByteArrayOutputStream();
91-
final byte[] buffer = new byte[Tv.THOUSAND];
90+
final byte[] buffer = new byte[1000];
9291
for (int bytes = content.read(buffer); bytes != -1;
9392
bytes = content.read(buffer)) {
9493
output.write(buffer, 0, bytes);

src/test/java/com/jcabi/http/ImmutableHeaderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* Test case for {@link ImmutableHeader}.
3939
* @since 1.1
4040
*/
41-
public final class ImmutableHeaderTest {
41+
final class ImmutableHeaderTest {
4242

4343
/**
4444
* ImmutableHeader can normalize headers.

src/test/java/com/jcabi/http/RequestITCaseTemplate.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030
package com.jcabi.http;
3131

32-
import com.jcabi.aspects.Tv;
3332
import com.jcabi.http.request.JdkRequest;
3433
import com.jcabi.http.response.JsonResponse;
3534
import com.jcabi.http.response.RestResponse;
@@ -147,7 +146,7 @@ final void sendsCookies() throws IOException {
147146
@Test
148147
final void followsLocationHeader() throws IOException {
149148
this.request("/absolute-redirect/5")
150-
.through(AutoRedirectingWire.class, Tv.SIX)
149+
.through(AutoRedirectingWire.class, 6)
151150
.fetch()
152151
.as(RestResponse.class)
153152
.assertStatus(HttpURLConnection.HTTP_OK);
@@ -156,7 +155,7 @@ final void followsLocationHeader() throws IOException {
156155
@Test
157156
final void followsLocationHeaderRelativeRedirect() throws IOException {
158157
this.request("/relative-redirect/5")
159-
.through(AutoRedirectingWire.class, Tv.SIX)
158+
.through(AutoRedirectingWire.class, 6)
160159
.fetch()
161160
.as(RestResponse.class)
162161
.assertStatus(HttpURLConnection.HTTP_OK);
@@ -168,7 +167,7 @@ final void failsOnTimeout() {
168167
IOException.class,
169168
() ->
170169
this.request("/delay/3")
171-
.timeout(Tv.THOUSAND, Tv.THOUSAND)
170+
.timeout(1000, 1000)
172171
.fetch()
173172
);
174173
}

src/test/java/com/jcabi/http/RequestSecondITCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
@SuppressWarnings("PMD.AbstractClassWithoutAbstractMethod")
4949
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
5050
@Testcontainers(disabledWithoutDocker = true)
51-
public final class RequestSecondITCase {
51+
final class RequestSecondITCase {
5252

5353
/**
5454
* Container with HttpBin.

src/test/java/com/jcabi/http/RequestTimeoutLossTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* @since 1.17.3
5252
*/
5353
@SuppressWarnings("PMD.TooManyMethods")
54-
public final class RequestTimeoutLossTest extends RequestTestTemplate {
54+
final class RequestTimeoutLossTest extends RequestTestTemplate {
5555
/**
5656
* Placeholder URL used for testing purposes only.
5757
*/

src/test/java/com/jcabi/http/mock/GrizzlyQueryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* Test case for {@link GrizzlyQuery}.
4242
* @since 1.13
4343
*/
44-
public final class GrizzlyQueryTest {
44+
final class GrizzlyQueryTest {
4545

4646
/**
4747
* GrizzlyQuery can return a body as a byte array.

src/test/java/com/jcabi/http/mock/MkAnswerMatchersTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Test case for {@link MkAnswerMatchers}.
4040
* @since 1.5
4141
*/
42-
public final class MkAnswerMatchersTest {
42+
final class MkAnswerMatchersTest {
4343

4444
/**
4545
* MkAnswerMatchers should be able to match MkAnswer body.

src/test/java/com/jcabi/http/mock/MkQueryMatchersTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* @since 1.5
4343
*/
44-
public final class MkQueryMatchersTest {
44+
final class MkQueryMatchersTest {
4545

4646
/**
4747
* MkQueryMatchers should be able to match MkQuery body.

src/test/java/com/jcabi/http/request/BoundaryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* Test case {@link Boundary}.
3939
* @since 1.17.3
4040
*/
41-
public final class BoundaryTest {
41+
final class BoundaryTest {
4242

4343
/**
4444
* Boundary builds valid string.

src/test/java/com/jcabi/http/request/DefaultResponseTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
* Test case for {@link DefaultResponse}.
4343
* @since 1.0
4444
*/
45-
public final class DefaultResponseTest {
45+
final class DefaultResponseTest {
4646

4747
/**
4848
* DefaultResponse can throw when entity is not a Unicode text.
4949
*/
5050
@Test
51-
public void throwsWhenEntityIsNotAUnicodeString() {
51+
void throwsWhenEntityIsNotAUnicodeString() {
5252
Assertions.assertThrows(
5353
RuntimeException.class,
5454
new Executable() {

src/test/java/com/jcabi/http/request/JdkRequestITCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030
package com.jcabi.http.request;
3131

32-
import com.jcabi.aspects.Tv;
3332
import java.io.IOException;
3433
import java.net.MalformedURLException;
3534
import java.net.URI;
@@ -124,7 +123,7 @@ public void execute() throws Throwable {
124123
StringUtils.join(
125124
url,
126125
colon,
127-
String.valueOf(Tv.EIGHTY)
126+
"80"
128127
)
129128
).fetch();
130129
}

src/test/java/com/jcabi/http/response/JsonResponseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Test case for {@link JsonResponse}.
4343
* @since 1.1
4444
*/
45-
public final class JsonResponseTest {
45+
final class JsonResponseTest {
4646

4747
/**
4848
* JsonResponse can read and return a JSON document.

src/test/java/com/jcabi/http/response/JsoupResponseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* @since 1.4
4343
*/
44-
public final class JsoupResponseTest {
44+
final class JsoupResponseTest {
4545

4646
/**
4747
* JsoupResponse normalizes malformed HTML responses.

src/test/java/com/jcabi/http/response/WebLinkingResponseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Test case for {@link WebLinkingResponse}.
4040
* @since 0.9
4141
*/
42-
public final class WebLinkingResponseTest {
42+
final class WebLinkingResponseTest {
4343

4444
/**
4545
* The Link header.

src/test/java/com/jcabi/http/response/XmlResponseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* @since 1.1
4444
*/
4545
@SuppressWarnings("PMD.TooManyMethods")
46-
public final class XmlResponseTest {
46+
final class XmlResponseTest {
4747

4848
/**
4949
* XmlResponse can find nodes with XPath.

src/test/java/com/jcabi/http/wire/AutoRedirectingWireTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030
package com.jcabi.http.wire;
3131

32-
import com.jcabi.aspects.Tv;
3332
import com.jcabi.http.mock.MkAnswer;
3433
import com.jcabi.http.mock.MkContainer;
3534
import com.jcabi.http.mock.MkGrizzlyContainer;
@@ -47,7 +46,7 @@
4746
*
4847
* @since 1.7
4948
*/
50-
public final class AutoRedirectingWireTest {
49+
final class AutoRedirectingWireTest {
5150

5251
/**
5352
* AutoRedirectingWire retries up to the specified number of times for
@@ -65,7 +64,7 @@ void retriesForHttpRedirectStatus() throws Exception {
6564
Integer.MAX_VALUE
6665
).start();
6766
try {
68-
final int retries = Tv.THREE;
67+
final int retries = 3;
6968
new JdkRequest(container.home())
7069
.through(AutoRedirectingWire.class, retries)
7170
.fetch().as(RestResponse.class)
@@ -101,7 +100,7 @@ void returnsValidResponseAfterRetry() throws Exception {
101100
.assertStatus(HttpStatus.SC_OK);
102101
MatcherAssert.assertThat(
103102
container.takeAll(Matchers.any(MkAnswer.class)),
104-
Matchers.<MkQuery>iterableWithSize(Tv.THREE)
103+
Matchers.<MkQuery>iterableWithSize(3)
105104
);
106105
} finally {
107106
container.stop();

src/test/java/com/jcabi/http/wire/CachingWireTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import com.google.common.cache.CacheBuilder;
3333
import com.google.common.cache.CacheLoader;
3434
import com.google.common.cache.LoadingCache;
35-
import com.jcabi.aspects.Tv;
3635
import com.jcabi.http.Request;
3736
import com.jcabi.http.Response;
3837
import com.jcabi.http.mock.MkAnswer;
@@ -63,7 +62,7 @@ void cachesGetRequest() throws Exception {
6362
).start();
6463
final Request req = new JdkRequest(container.home())
6564
.through(CachingWire.class);
66-
for (int idx = 0; idx < Tv.TEN; ++idx) {
65+
for (int idx = 0; idx < 10; ++idx) {
6766
req.fetch().as(RestResponse.class)
6867
.assertStatus(HttpURLConnection.HTTP_OK);
6968
}
@@ -118,7 +117,7 @@ void flushesOnRegularExpressionMatch() throws Exception {
118117
container.stop();
119118
MatcherAssert.assertThat(
120119
container.queries(),
121-
Matchers.equalTo(Tv.THREE)
120+
Matchers.equalTo(3)
122121
);
123122
}
124123

@@ -147,7 +146,7 @@ public Response load(final Callable<Response> query)
147146
);
148147
final Request req = new JdkRequest(container.home())
149148
.through(CachingWire.class, cache);
150-
for (int idx = 0; idx < Tv.TEN; ++idx) {
149+
for (int idx = 0; idx < 10; ++idx) {
151150
req.fetch().as(RestResponse.class)
152151
.assertStatus(HttpURLConnection.HTTP_OK);
153152
}

src/test/java/com/jcabi/http/wire/CookieOptimizingWireTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* Test case for {@link CookieOptimizingWire}.
4646
* @since 1.0
4747
*/
48-
public final class CookieOptimizingWireTest {
48+
final class CookieOptimizingWireTest {
4949

5050
/**
5151
* CookieOptimizingWire can transfer cookies.

src/test/java/com/jcabi/http/wire/ETagCachingWireTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* Test case for {@link ETagCachingWire}.
4646
* @since 2.0
4747
*/
48-
public final class ETagCachingWireTest {
48+
final class ETagCachingWireTest {
4949

5050
/**
5151
* ETagCachingWire can take content from cache.

src/test/java/com/jcabi/http/wire/FcWireTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030
package com.jcabi.http.wire;
3131

32-
import com.jcabi.aspects.Tv;
3332
import com.jcabi.http.Request;
3433
import com.jcabi.http.mock.MkAnswer;
3534
import com.jcabi.http.mock.MkContainer;
@@ -45,7 +44,7 @@
4544
* Test case for {@link FcWire}.
4645
* @since 1.0
4746
*/
48-
public final class FcWireTest {
47+
final class FcWireTest {
4948

5049
/**
5150
* FileCachingWire can cache GET requests.
@@ -58,7 +57,7 @@ void cachesGetRequest() throws Exception {
5857
).start();
5958
final Request req = new JdkRequest(container.home())
6059
.through(FcWire.class);
61-
for (int idx = 0; idx < Tv.TEN; ++idx) {
60+
for (int idx = 0; idx < 10; ++idx) {
6261
req.fetch().as(RestResponse.class)
6362
.assertStatus(HttpURLConnection.HTTP_OK);
6463
}
@@ -113,7 +112,7 @@ void flushesOnRegularExpressionMatch() throws Exception {
113112
container.stop();
114113
MatcherAssert.assertThat(
115114
container.queries(),
116-
Matchers.equalTo(Tv.THREE)
115+
Matchers.equalTo(3)
117116
);
118117
}
119118

0 commit comments

Comments
 (0)