Skip to content

Commit 3e1dd7a

Browse files
committed
Fix registry URL assertion and update recently updated package names test
1 parent 77c78a1 commit 3e1dd7a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/models/ecosystem/maven_test.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MavenTest < ActiveSupport::TestCase
1616

1717
test 'registry_url with version' do
1818
registry_url = @ecosystem.registry_url(@package, @version)
19-
assert_equal registry_url, "https://central.sonatype.com/artifact/dev.zio/zio-aws-autoscaling_3/5.17.224.2/"
19+
assert_equal registry_url, "https://central.sonatype.com/artifact/dev.zio/zio-aws-autoscaling_3/5.17.224.2"
2020
end
2121

2222
test 'download_url' do
@@ -70,10 +70,19 @@ class MavenTest < ActiveSupport::TestCase
7070
end
7171

7272
test 'recently_updated_package_names' do
73+
stub_request(:post, "https://central.sonatype.com/api/internal/browse/components?repository=maven-central")
74+
.with(
75+
body: "{\"size\":20,\"sortField\":\"publishedDate\",\"sortDirection\":\"desc\"}",
76+
headers: {
77+
'Content-Type'=>'application/json',
78+
'Expect'=>'',
79+
'User-Agent'=>'packages.ecosyste.ms ([email protected])'
80+
})
81+
.to_return(status: 200, body: '{"items":[]}', headers: {})
7382
stub_request(:get, "https://maven.libraries.io/mavenCentral/recent")
7483
.to_return({ status: 200, body: file_fixture('maven/recent') })
7584
recently_updated_package_names = @ecosystem.recently_updated_package_names
76-
assert_equal recently_updated_package_names.length, 100
85+
assert_equal recently_updated_package_names.length, 20
7786
end
7887

7988
test 'package_metadata' do

0 commit comments

Comments
 (0)