Skip to content

Commit

Permalink
Remove unwanted test dependency as requested in #101
Browse files Browse the repository at this point in the history
Use slf4j instead of apache logging
  • Loading branch information
mayur-solace committed Jul 17, 2024
1 parent f7897cc commit 1f54f96
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>1.19.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
import static com.solacesystems.jcsmp.JCSMPProperties.AUTHENTICATION_SCHEME_OAUTH2;
import static com.solacesystems.jcsmp.SessionEvent.RECONNECTING;
import java.util.Objects;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
* Default implementation of SolaceOAuth2SessionEventHandler. This class handles the OAuth2 token
* refresh logic when the session is reconnecting.
*/
public class DefaultSolaceOAuth2SessionEventHandler implements SolaceOAuth2SessionEventHandler {

private static final Log logger = LogFactory.getLog(DefaultSolaceOAuth2SessionEventHandler.class);
private static final Logger logger = LoggerFactory.getLogger(DefaultSolaceOAuth2SessionEventHandler.class);

protected final SolaceSessionOAuth2TokenProvider solaceSessionOAuth2TokenProvider;
protected final JCSMPProperties jcsmpProperties;
Expand Down Expand Up @@ -60,7 +61,7 @@ private void refreshOAuth2AccessToken() {
this.jcsmpSession.setProperty(JCSMPProperties.OAUTH2_ACCESS_TOKEN, newAccessToken);
} catch (JCSMPException e) {
if (logger.isDebugEnabled()) {
logger.debug("Exception while fetching/providing refreshed access token: " + e);
logger.debug("Exception while fetching/providing refreshed access token: ", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static com.solacesystems.jcsmp.JCSMPProperties.USERNAME;
import com.solace.spring.boot.autoconfigure.SolaceJavaProperties;
import java.util.Objects;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.oauth2.client.AuthorizedClientServiceOAuth2AuthorizedClientManager;
import org.springframework.security.oauth2.client.OAuth2AuthorizeRequest;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;
Expand All @@ -17,7 +17,7 @@
*/
public class DefaultSolaceSessionOAuth2TokenProvider implements SolaceSessionOAuth2TokenProvider {

private static final Log logger = LogFactory.getLog(
private static final Logger logger = LoggerFactory.getLogger(
DefaultSolaceSessionOAuth2TokenProvider.class);

private final JCSMPProperties jcsmpProperties;
Expand Down Expand Up @@ -68,7 +68,7 @@ public String getAccessToken() {
return accessToken.getTokenValue();
} catch (Throwable t) {
if (logger.isDebugEnabled()) {
logger.debug("Exception while fetching OAuth2 access token: " + t);
logger.debug("Exception while fetching OAuth2 access token.", t);
}
throw t;
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>1.19.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/
package com.solace.spring.boot.autoconfigure;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import com.solacesystems.jms.SolConnectionFactoryImpl;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
Expand Down

0 comments on commit 1f54f96

Please sign in to comment.