Skip to content

Instantly share code, notes, and snippets.

@fuss86
Created September 18, 2019 23:50
Show Gist options
  • Save fuss86/bfcded6ee2d69aefd31fc7d84130efaa to your computer and use it in GitHub Desktop.
Save fuss86/bfcded6ee2d69aefd31fc7d84130efaa to your computer and use it in GitHub Desktop.
diff --git a/strongbox-resources/strongbox-common-resources/src/main/resources/logback-spring.xml b/strongbox-resources/strongbox-common-resources/src/main/resources/logback-spring.xml
index 418801198..01fa61c51 100644
--- a/strongbox-resources/strongbox-common-resources/src/main/resources/logback-spring.xml
+++ b/strongbox-resources/strongbox-common-resources/src/main/resources/logback-spring.xml
@@ -133,6 +133,8 @@
<logger name ="liquibase.parser.core.xml" level="INFO" />
<logger name ="javax.xml.bind" level="INFO" />
<logger name="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" level="DEBUG" />
+ <logger name="org.springframework.test" level="TRACE" />
+ <logger name="org.carlspring.strongbox.testing" level="TRACE" />
<!-- Third-party packages -->
<root level="DEBUG"/>
@@ -173,6 +175,8 @@
<logger name ="liquibase.parser.core.xml" level="INFO" />
<logger name ="javax.xml.bind" level="INFO" />
<logger name="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" level="INFO" />
+ <logger name="org.springframework.test" level="TRACE" />
+ <logger name="org.carlspring.strongbox.testing" level="TRACE" />
<!-- Third-party packages -->
<root level="INFO"/>
diff --git a/strongbox-web-core/src/main/java/org/carlspring/strongbox/controllers/configuration/security/ldap/LdapAuthenticatorConfigurationController.java b/strongbox-web-core/src/main/java/org/carlspring/strongbox/controllers/configuration/security/ldap/LdapAuthenticatorConfigurationController.java
index 34a43f365..c52bc05d7 100644
--- a/strongbox-web-core/src/main/java/org/carlspring/strongbox/controllers/configuration/security/ldap/LdapAuthenticatorConfigurationController.java
+++ b/strongbox-web-core/src/main/java/org/carlspring/strongbox/controllers/configuration/security/ldap/LdapAuthenticatorConfigurationController.java
@@ -1,5 +1,6 @@
package org.carlspring.strongbox.controllers.configuration.security.ldap;
+import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.carlspring.strongbox.authentication.external.ldap.LdapAuthenticationConfigurationManager;
@@ -7,6 +8,11 @@ import org.carlspring.strongbox.authentication.external.ldap.LdapConfiguration;
import org.carlspring.strongbox.controllers.BaseController;
import org.carlspring.strongbox.forms.configuration.security.ldap.LdapConfigurationTestForm;
import org.carlspring.strongbox.validation.RequestBodyValidationException;
+
+import java.util.Arrays;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@@ -53,6 +59,14 @@ public class LdapAuthenticatorConfigurationController
private static final String ERROR_PUT_LDAP_TEST = "Failed to test LDAP configuration.";
+ @Autowired
+ private ApplicationContext applicationContext; // TODO remove me
+
+ @PostConstruct
+ public void postConstruct() { // TODO remove me
+ logger.info(String.format("LdapAuthenticatorConfigurationController.postConstruct [%s][%s]", this, applicationContext));
+ }
+
@Inject
private LdapAuthenticationConfigurationManager ldapAuthenticationManager;
@@ -63,6 +77,11 @@ public class LdapAuthenticatorConfigurationController
BindingResult bindingResult,
@RequestHeader(HttpHeaders.ACCEPT) String acceptHeader)
{
+ logger.info(String.format("LdapAuthenticatorConfigurationController.testLdapConfiguration [%s][%s][%s]", // TODO remove me
+ this,
+ applicationContext,
+ Arrays.toString(Thread.currentThread().getStackTrace())));
+
if (bindingResult.hasErrors())
{
throw new RequestBodyValidationException(FAILED_PUT_LDAP_TEST, bindingResult);
diff --git a/strongbox-web-core/src/test/java/org/carlspring/strongbox/config/IntegrationTest.java b/strongbox-web-core/src/test/java/org/carlspring/strongbox/config/IntegrationTest.java
index c2044848c..787f5f62f 100644
--- a/strongbox-web-core/src/test/java/org/carlspring/strongbox/config/IntegrationTest.java
+++ b/strongbox-web-core/src/test/java/org/carlspring/strongbox/config/IntegrationTest.java
@@ -40,7 +40,6 @@ import org.springframework.test.context.web.WebAppConfiguration;
MockedRemoteRepositoriesHeartbeatConfig.class,
IntegrationTest.IntegrationTestsConfiguration.class,
TestingCoreConfig.class })
-@WebAppConfiguration("classpath:")
@WithUserDetails("admin")
@ActiveProfiles("test")
@TestExecutionListeners(listeners = { RestAssuredTestExecutionListener.class,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment