Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Optimize intellij plugin installation tests #968

Open
jan-vcapgemini opened this issue Jan 21, 2025 · 0 comments
Open

Optimize intellij plugin installation tests #968

jan-vcapgemini opened this issue Jan 21, 2025 · 0 comments
Labels
good first issue Good for newcomers intellij IntelliJ IDE from Jet-Brains

Comments

@jan-vcapgemini
Copy link
Contributor

jan-vcapgemini commented Jan 21, 2025

What I still dislike is this stuff in the JUnit:

    String content = "plugin_id=mockedPlugin\nplugin_active=true\nplugin_url=http://customRepo";
    Files.write(this.context.getSettingsPath().resolve("intellij").resolve("plugins").resolve("MockedPlugin.properties"),
        content.getBytes(StandardCharsets.UTF_8));

We have solved this problem in other tests by adding plugin configuration properties file to the test project using a variable for the wiremock base URL and have some generic solution to replace the variable.
We should align IntellijTest with other tests using the better pattern, but let us not block this PR. Ready for merge.

Originally posted by @hohwille in #909 (review)

Hint:

We need to replace this workaround with 2 simple plugin property files (one with status active true and the other with active false)
See:

private void setupMockedPlugin(boolean mockedPluginActive) throws IOException {
String content = "plugin_id=mockedPlugin\nplugin_active=" + mockedPluginActive;
Files.write(this.context.getSettingsPath().resolve("intellij").resolve("plugins").resolve("MockedPlugin.properties"),
content.getBytes(StandardCharsets.UTF_8));
}
private void setupMockedPluginWithCustomToolUrl() throws IOException {
String content = "plugin_id=mockedPlugin\nplugin_active=true\nplugin_url=http://customRepo";
Files.write(this.context.getSettingsPath().resolve("intellij").resolve("plugins").resolve("MockedPlugin.properties"),
content.getBytes(StandardCharsets.UTF_8));
}

@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Jan 21, 2025
@jan-vcapgemini jan-vcapgemini moved this from 🆕 New to Refinement in IDEasy board Jan 21, 2025
@jan-vcapgemini jan-vcapgemini added intellij IntelliJ IDE from Jet-Brains good first issue Good for newcomers labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers intellij IntelliJ IDE from Jet-Brains
Projects
Status: Refinement
Development

No branches or pull requests

1 participant