Skip to content

Polish #7030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Polish #7030

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,16 @@ static class DataSourceAvailableCondition extends SpringBootCondition {
public ConditionOutcome getMatchOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) {
ConditionMessage.Builder message = ConditionMessage
.forCondition("EmbeddedDataAvailable");
.forCondition("DataSourceAvailable");
if (hasBean(context, DataSource.class)
|| hasBean(context, XADataSource.class)) {
return ConditionOutcome
.match(message.foundExactly("existing database bean"));
.match(message.foundExactly("existing data source bean"));
}
if (anyMatches(context, metadata, this.pooledCondition,
this.embeddedCondition)) {
return ConditionOutcome
.match(message.foundExactly("existing auto-configured database"));
.match(message.foundExactly("existing auto-configured data source bean"));
}
return ConditionOutcome
.noMatch(message.didNotFind("any existing data source bean").atAll());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public ConditionOutcome getMatchOutcome(ConditionContext context,
}
if (StringUtils.hasText(resolver.getProperty("user-info-uri"))) {
return ConditionOutcome
.match(message.foundExactly("user-info-url property"));
.match(message.foundExactly("user-info-uri property"));
}
if (ClassUtils.isPresent(AUTHORIZATION_ANNOTATION, null)) {
if (AuthorizationServerEndpointsConfigurationBeanCondition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
class OnEnabledResourceChainCondition extends SpringBootCondition {

private static final String WEBJAR_ASSERT_LOCATOR = "org.webjars.WebJarAssetLocator";
private static final String WEBJAR_ASSET_LOCATOR = "org.webjars.WebJarAssetLocator";

@Override
public ConditionOutcome getMatchOutcome(ConditionContext context,
Expand All @@ -50,13 +50,13 @@ public ConditionOutcome getMatchOutcome(ConditionContext context,
ConditionMessage.Builder message = ConditionMessage
.forCondition(ConditionalOnEnabledResourceChain.class);
if (match == null) {
if (ClassUtils.isPresent(WEBJAR_ASSERT_LOCATOR,
if (ClassUtils.isPresent(WEBJAR_ASSET_LOCATOR,
getClass().getClassLoader())) {
return ConditionOutcome
.match(message.found("class").items(WEBJAR_ASSERT_LOCATOR));
.match(message.found("class").items(WEBJAR_ASSET_LOCATOR));
}
return ConditionOutcome
.noMatch(message.didNotFind("class").items(WEBJAR_ASSERT_LOCATOR));
.noMatch(message.didNotFind("class").items(WEBJAR_ASSET_LOCATOR));
}
if (match) {
return ConditionOutcome.match(message.because("enabled"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public void isEmptyWhenNotEmptyShouldReturnFalse() throws Exception {
}

@Test
public void toStringWhenHasMessageShouldReturnMessage() throws Exception {
public void toStringWhenEmptyShouldReturnEmptyString() throws Exception {
ConditionMessage message = ConditionMessage.empty();
assertThat(message.toString()).isEqualTo("");
}

@Test
public void toStringWhenEmptyShouldReturnEmptyString() throws Exception {
public void toStringWhenHasMessageShouldReturnMessage() throws Exception {
ConditionMessage message = ConditionMessage.of("Test");
assertThat(message.toString()).isEqualTo("Test");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import java.lang.reflect.Field;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
Expand All @@ -47,9 +45,6 @@
*/
public class QualifierDefinitionTests {

@Rule
public ExpectedException thrown = ExpectedException.none();

@Mock
private ConfigurableListableBeanFactory beanFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import static org.junit.Assert.assertTrue

def file = new File(basedir, "build.log")
assertTrue 'Devtools should have been detected', file.text.contains('Fork mode disabled, devtools will be disabled')
assertTrue 'Application should have ran', file.text.contains("I haz been run")
assertTrue 'Application should have run', file.text.contains("I haz been run")