Skip to content

Commit

Permalink
Merge pull request #1017 from amvanbaren/sonar-package-private-tests
Browse files Browse the repository at this point in the history
Remove public access modifier from tests
  • Loading branch information
amvanbaren authored Oct 9, 2024
2 parents 5bab0cb + a1a17e7 commit 6529ab1
Show file tree
Hide file tree
Showing 20 changed files with 319 additions and 319 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@
import static org.assertj.core.api.Assertions.assertThat;

@ExtendWith(SpringExtension.class)
public class ExtensionValidatorTest {
class ExtensionValidatorTest {

@Autowired
ExtensionValidator validator;

@Test
public void testInvalidVersion1() {
void testInvalidVersion1() {
var issue = validator.validateExtensionVersion("latest");
assertThat(issue).isPresent();
assertThat(issue.get())
.isEqualTo(new ExtensionValidator.Issue("The version string 'latest' is reserved."));
}

@Test
public void testInvalidVersion2() {
void testInvalidVersion2() {
var issue = validator.validateExtensionVersion("1/2");
assertThat(issue).isPresent();
assertThat(issue.get())
.isEqualTo(new ExtensionValidator.Issue("Invalid semantic version. See https://semver.org/."));
}

@Test
public void testInvalidTargetPlatform() {
void testInvalidTargetPlatform() {
var extension = new ExtensionVersion();
extension.setTargetPlatform("debian-x64");
extension.setVersion("1.0.0");
Expand All @@ -54,7 +54,7 @@ public void testInvalidTargetPlatform() {
}

@Test
public void testInvalidURL() {
void testInvalidURL() {
var extension = new ExtensionVersion();
extension.setTargetPlatform(TargetPlatform.NAME_UNIVERSAL);
extension.setVersion("1.0.0");
Expand All @@ -66,7 +66,7 @@ public void testInvalidURL() {
}

@Test
public void testInvalidURL2() {
void testInvalidURL2() {
var extension = new ExtensionVersion();
extension.setTargetPlatform(TargetPlatform.NAME_UNIVERSAL);
extension.setVersion("1.0.0");
Expand All @@ -78,7 +78,7 @@ public void testInvalidURL2() {
}

@Test
public void testInvalidURL3() {
void testInvalidURL3() {
var extension = new ExtensionVersion();
extension.setTargetPlatform(TargetPlatform.NAME_UNIVERSAL);
extension.setVersion("1.0.0");
Expand All @@ -90,7 +90,7 @@ public void testInvalidURL3() {
}

@Test
public void testMailtoURL() {
void testMailtoURL() {
var extension = new ExtensionVersion();
extension.setTargetPlatform(TargetPlatform.NAME_UNIVERSAL);
extension.setVersion("1.0.0");
Expand All @@ -100,7 +100,7 @@ public void testMailtoURL() {
}

@Test
public void testGitProtocol() {
void testGitProtocol() {
var extension = new ExtensionVersion();
extension.setTargetPlatform(TargetPlatform.NAME_UNIVERSAL);
extension.setVersion("1.0.0");
Expand Down
6 changes: 3 additions & 3 deletions server/src/test/java/org/eclipse/openvsx/IntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
public class IntegrationTest {
class IntegrationTest {

protected final Logger logger = LoggerFactory.getLogger(IntegrationTest.class);

Expand All @@ -48,7 +48,7 @@ private String apiCall(String path) {
}

@Test
public void testPublishExtension() throws Exception {
void testPublishExtension() throws Exception {
testService.createUser();
createNamespace();
getNamespaceMetadata("/api/editorconfig");
Expand Down Expand Up @@ -203,7 +203,7 @@ private void searchExtension() {
.isEqualTo("EditorConfig Support for Visual Studio Code");
}

public void getVscodeDownloadLink() throws URISyntaxException {
void getVscodeDownloadLink() throws URISyntaxException {
var path = "/vscode/gallery/publishers/editorconfig/vsextensions/editorconfig/0.16.6/vspackage";
var response = restTemplate.getForEntity(apiCall(path), String.class);
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.FOUND);
Expand Down
Loading

0 comments on commit 6529ab1

Please sign in to comment.