Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
toby1984 committed Jun 24, 2024
1 parent 12a39f8 commit 3db3274
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Copyright 2018 Tobias Gierke <tobias.gierke@code-sourcery.de>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.codesourcery.versiontracker.common.server;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import com.github.tomakehurst.wiremock.junit5.WireMockTest;
import de.codesourcery.versiontracker.common.Artifact;
import de.codesourcery.versiontracker.common.IVersionProvider;
import de.codesourcery.versiontracker.common.Version;
import de.codesourcery.versiontracker.common.VersionInfo;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.io.FileNotFoundException;
Expand All @@ -43,6 +44,19 @@
@WireMockTest
public class MavenCentralVersionProviderTest {

private ConfigurationProvider configProvider;

@BeforeEach
void setup() {
configProvider = new ConfigurationProvider();
}

@AfterEach
void tearDown() throws InterruptedException
{
configProvider.close();
}

@Test
public void testScrapingOnlyLatestVersions(WireMockRuntimeInfo webServer) throws IOException {
doTest(webServer, false );
Expand All @@ -59,6 +73,7 @@ private void doTest(WireMockRuntimeInfo webServer, boolean scrapeAdditionalRelea
final String repo1BaseUrl = "http://localhost:" + webServer.getHttpPort();

final MavenCentralVersionProvider provider = new MavenCentralVersionProvider( repo1BaseUrl, restApiBaseUrl );
provider.setConfigurationProvider( configProvider );

final VersionInfo info = new VersionInfo();
info.artifact = new Artifact();
Expand Down

0 comments on commit 3db3274

Please sign in to comment.