Skip to content
New issue

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

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

Already on GitHub? # to your account

Use parameterized test for CamelCatalogVersionTest #795

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -31,31 +31,25 @@
import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.jsonrpc.messages.Either;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import com.github.cameltooling.lsp.internal.util.RouteTextBuilder;

class CamelCatalogVersionTest extends AbstractCamelLanguageServerTest {

private String camelCatalogVersion;

@Test
void testCompletionWithAnotherCatalog2xVersionLoaded() throws Exception {
camelCatalogVersion = "2.23.4";

CamelLanguageServer camelLanguageServer = basicCompletionCheckBefore3_3();

checkLoadedCamelCatalogVersion(camelLanguageServer, camelCatalogVersion);
}

@Test
void testCompletionWithCatalog3xVersionLoaded() throws Exception {
camelCatalogVersion = "3.0.0-RC3";
@ParameterizedTest
@ValueSource(strings = {"2.23.4", "3.0.0-RC3", "2.23.2.fuse-7_11_0-00037-redhat-00001"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without labels to understand what each string tests I really feel like we lose a ton of valuable information and, in case the test fails, it won't help us understand at all that each one is a different use case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each parameter is seen as a different test in the result.
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the screenshot of the corresponding tests:
image

void testCompletionWithAnotherOldCatalog(String camelVersion) throws Exception {
camelCatalogVersion = camelVersion;

CamelLanguageServer camelLanguageServer = basicCompletionCheckBefore3_3();

checkLoadedCamelCatalogVersion(camelLanguageServer, camelCatalogVersion);
}

@Test
void testUpdateOfConfig() throws Exception {
camelCatalogVersion = "3.0.0-RC3";
Expand Down Expand Up @@ -83,16 +77,7 @@ void testCompletionFallbackWithNullVersion() throws Exception {

basicCompletionCheck();
}

@Test
void testProductizedCatalog2x() throws Exception {
camelCatalogVersion = "2.23.2.fuse-7_11_0-00037-redhat-00001";

CamelLanguageServer camelLanguageServer = basicCompletionCheckBefore3_3();

checkLoadedCamelCatalogVersion(camelLanguageServer, camelCatalogVersion);
}


@Test
void testProductizedCatalog3x() throws Exception {
camelCatalogVersion = "3.11.5.fuse-800012-redhat-00004";
Expand Down