Skip to content

Commit 648cc93

Browse files
committed
Fixed test suite
1 parent 0f85e96 commit 648cc93

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
.settings/
44
.gradle/
55
.DS_Store
6-
bin
6+
bin
7+
build/

subprojects/redis-enterprise-admin/redis-enterprise-admin.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ dependencies {
44
implementation 'org.apache.httpcomponents.client5:httpclient5'
55
testImplementation 'org.slf4j:slf4j-simple'
66
testImplementation group: 'com.redis.testcontainers', name: 'testcontainers-redis-junit-jupiter', version: testcontainersRedisVersion
7+
}
8+
9+
eclipse {
10+
project {
11+
name = 'redis-enterprise-admin-core'
12+
}
713
}

subprojects/redis-enterprise-admin/src/main/java/com/redis/enterprise/Admin.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,10 @@ private <T> T read(ClassicHttpRequest request, Class<T> type, int successCode)
153153
private <T> T read(ClassicHttpRequest request, JavaType type, int successCode)
154154
throws GeneralSecurityException, IOException, ParseException {
155155
ClassicHttpResponse response = execute(request);
156-
String responseString = EntityUtils.toString(response.getEntity());
157156
if (response.getCode() == successCode) {
158-
return objectMapper.readValue(responseString, type);
157+
return objectMapper.readValue(EntityUtils.toString(response.getEntity()), type);
159158
}
160-
throw new HttpResponseException(response.getCode(), responseString);
159+
throw new HttpResponseException(response.getCode(), response.getReasonPhrase());
161160
}
162161

163162
private ClassicHttpResponse execute(ClassicHttpRequest request) throws GeneralSecurityException, IOException {

subprojects/redis-enterprise-admin/src/test/java/com/redis/testcontainers/test/AdminTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import org.junit.jupiter.api.Assertions;
1010
import org.junit.jupiter.api.BeforeAll;
1111
import org.junit.jupiter.api.Test;
12+
import org.junit.jupiter.api.TestInstance;
13+
import org.junit.jupiter.api.TestInstance.Lifecycle;
1214
import org.testcontainers.junit.jupiter.Container;
1315
import org.testcontainers.junit.jupiter.Testcontainers;
1416

@@ -17,6 +19,7 @@
1719
import com.redis.testcontainers.RedisEnterpriseContainer;
1820

1921
@Testcontainers
22+
@TestInstance(Lifecycle.PER_CLASS)
2023
class AdminTests {
2124

2225
@Container

0 commit comments

Comments
 (0)