@@ -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