Skip to content

Commit 190c61b

Browse files
author
Johan Aludden
committed
Fixed failing test
1 parent cab8aa8 commit 190c61b

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

ipp-v3-java-devkit/src/test/java/com/intuit/ipp/interceptors/PrepareRequestInterceptorTest.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,20 @@ public void testExecuteWithPlatformService() throws FMSException {
7373

7474
@Test
7575
public void testExecuteWithEntitlementService() throws FMSException {
76-
message.setEntitlementService(true);
77-
instance.execute(message);
78-
79-
Assert.assertEquals(message.getRequestElements().getRequestParameters().get(RequestElements.REQ_PARAM_RESOURCE_URL), Config.getProperty(Config.BASE_URL_ENTITLEMENTSERVICE) + "/entitlements/v3/fakeRealm");
80-
Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_CONTENT_TYPE), "application/xml");
81-
Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_ACCEPT), "application/xml");
82-
Assert.assertNull(message.getRequestElements().getRequestHeaders().get(Config.COMPRESSION_REQUEST_FORMAT));
83-
Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_CONTENT_ENCODING), Config.getProperty(Config.COMPRESSION_REQUEST_FORMAT));
76+
String originalCompression = Config.getProperty(COMPRESSION_REQUEST_FORMAT);
77+
try {
78+
Config.setProperty(COMPRESSION_REQUEST_FORMAT, CompressorFactory.GZIP_COMPRESS_FORMAT);
79+
message.setEntitlementService(true);
80+
instance.execute(message);
81+
82+
Assert.assertEquals(message.getRequestElements().getRequestParameters().get(RequestElements.REQ_PARAM_RESOURCE_URL), Config.getProperty(Config.BASE_URL_ENTITLEMENTSERVICE) + "/entitlements/v3/fakeRealm");
83+
Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_CONTENT_TYPE), "application/xml");
84+
Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_ACCEPT), "application/xml");
85+
Assert.assertNull(message.getRequestElements().getRequestHeaders().get(Config.COMPRESSION_REQUEST_FORMAT));
86+
Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_CONTENT_ENCODING), Config.getProperty(Config.COMPRESSION_REQUEST_FORMAT));
87+
} finally {
88+
Config.setProperty(COMPRESSION_REQUEST_FORMAT, originalCompression);
89+
}
8490
}
8591

8692
@Test

0 commit comments

Comments
 (0)