-
Notifications
You must be signed in to change notification settings - Fork 123
Avoid unecessary operations in kb-importer #537
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
base: master
Are you sure you want to change the base?
Changes from 8 commits
6721b1d
1a6297e
94597d5
764cef9
04b50a4
e6e3346
bbd4116
c0ea508
3d83e6c
e0dcbff
8247b13
8e8c751
0e79f95
93b0f7a
4e50e90
fbebcd9
af7b43b
d9a4e6f
d28d6f1
599a161
59b00cf
cc11bee
097f464
5ed1c79
ecfa8c1
86f6b25
1964773
f46b984
89ab062
16f9e37
4b6d787
38eeda3
65346d7
2f8a01f
7b12ce6
738c8f1
0930dea
8e3f885
ee870dd
c827f28
e170624
9e4e4b5
bf286d1
1b56295
9e929d5
a949408
6bb6895
5e41ded
dc06822
9b07d69
4d2dffd
38b25e6
d6a04e3
0016296
5fbf2a7
6748bf0
caf4d55
d65daaa
14a6e22
7999bf7
d9f9dc3
e1186cc
ebdc259
86a433b
62b6b17
a326de9
e3d3381
7f2829b
51cafa2
914bdb9
d8436f1
1260868
6c24fa5
59c4fb1
a4b766c
727698e
676edd1
2e966d9
29636df
b33c727
2339bc9
1aa0265
dfcd0a6
1222d2b
bfc4ac4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,11 +18,19 @@ | |
| */ | ||
| package org.eclipse.steady.kb.command; | ||
|
|
||
| import org.eclipse.steady.kb.task.MockBackConnector; | ||
| import org.eclipse.steady.kb.model.Vulnerability; | ||
|
|
||
| import static org.junit.Assert.assertEquals; | ||
| import static org.junit.Assert.assertTrue; | ||
| import static org.junit.Assert.assertNull; | ||
| import java.util.HashMap; | ||
| import org.apache.commons.cli.Options; | ||
|
|
||
| import java.io.IOException; | ||
| import org.eclipse.steady.kb.exception.ValidationException; | ||
| import com.google.gson.JsonSyntaxException; | ||
| import org.eclipse.steady.backend.BackendConnectionException; | ||
| import org.junit.Test; | ||
|
|
||
| public class ImportTest { | ||
|
|
@@ -52,4 +60,18 @@ public void validationFail() throws ValidationException { | |
| args.put("d", "invalidDir"); | ||
| command.validate(args); | ||
| } | ||
|
|
||
| @Test | ||
| public void testImportSkipExistingBug() | ||
| throws JsonSyntaxException, IOException, BackendConnectionException { | ||
| Vulnerability vuln = new Vulnerability(); | ||
| vuln.setVulnId("CVE-TEST01"); | ||
| MockBackConnector mockBackendConnector = new MockBackConnector(); | ||
| HashMap<String, Object> args = new HashMap<String, Object>(); | ||
| args.put("o", false); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the arguments should be treated as properties with the same naming convention used in other modules and making use of org.eclipse.steady.shared.util.VulasConfiguration , e.g., vulas.kb-importer.overwrite
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are currently defined as constants in the ImportCommand. Should I move it to the properties file or just use these constants? |
||
| args.put("v", false); | ||
| Import command = new Import(mockBackendConnector); | ||
| command.run(args); | ||
| assertNull(mockBackendConnector.getUploadJson()); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| kb-importer/src/test/java/org/eclipse/steady/kb/task/TestImportVulnerability.java | ||
|
pedrogalvao marked this conversation as resolved.
Outdated
|
||
| kb-importer/src/test/java/org/eclipse/steady/kb/command/ImportTest.java | ||
Uh oh!
There was an error while loading. Please reload this page.