Skip to content

Commit 0b2613c

Browse files
author
Glyn Normington
committed
Merge 59398214-spring-framework-detection to master
[Completes #59398214]
2 parents 95f0d50 + 329c0f5 commit 0b2613c

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

lib/java_buildpack/framework/spring_auto_reconfiguration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def supports?
4747

4848
private
4949

50-
SPRING_JAR_PATTERN = 'spring-core*.jar'.freeze
50+
SPRING_JAR_PATTERN = '*spring-core*.jar'.freeze
5151

5252
WEB_XML = File.join 'WEB-INF', 'web.xml'.freeze
5353

spec/fixtures/framework_auto_reconfiguration_long_spring_jar_name/WEB-INF/lib/org.springframework.spring-core-3.2.3.RELEASE.jar

Whitespace-only changes.

spec/java_buildpack/framework/spring_auto_reconfiguration_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ module JavaBuildpack::Framework
4444
expect(detected).to eq('spring-auto-reconfiguration=0.6.8')
4545
end
4646

47+
it 'should detect with Spring JAR which has a long name' do
48+
JavaBuildpack::Repository::ConfiguredItem.stub(:find_item).and_return(SPRING_AUTO_RECONFIGURATION_DETAILS)
49+
50+
detected = SpringAutoReconfiguration.new(
51+
app_dir: 'spec/fixtures/framework_auto_reconfiguration_long_spring_jar_name',
52+
configuration: {}
53+
).detect
54+
55+
expect(detected).to eq('spring-auto-reconfiguration=0.6.8')
56+
end
57+
4758
it 'should not detect without Spring JAR' do
4859
detected = SpringAutoReconfiguration.new(
4960
app_dir: 'spec/fixtures/framework_none',

0 commit comments

Comments
 (0)