1010import javax .swing .*;
1111import java .awt .*;
1212
13- import static org .junit .Assert .assertEquals ;
14- import static org .junit .Assert .assertTrue ;
13+ import static org .junit .Assert .*;
1514import static org .mockito .Mockito .spy ;
1615
1716public class SnippetsPanelTest extends AbstractTestBase {
@@ -34,11 +33,11 @@ public void testSelection() throws Exception {
3433 Framework framework = createFramework ();
3534 framework .restoreData ();
3635
37- SnippetsPanel snippetsTab = new SnippetsPanel (framework );
38- SnippetsTable snippetsTable = snippetsTab .getSnippetsTable ();
36+ SnippetsPanel snippetsPanel = new SnippetsPanel (framework );
37+ SnippetsTable snippetsTable = snippetsPanel .getSnippetsTable ();
3938
4039 snippetsTable .fireSnippetsChanged ();
41- JPanel snippetViewFormPanel = snippetsTab .getSnippetViewFormPane ();
40+ JPanel snippetViewFormPanel = snippetsPanel .getSnippetViewFormPane ();
4241 JTable jTable = snippetsTable .getJTable ();
4342
4443 assertEquals (1 , snippetViewFormPanel .getComponentCount ());
@@ -54,11 +53,11 @@ public void testSelection() throws Exception {
5453
5554 @ Test
5655 public void disableEnableButtonsForSnippet () throws Exception {
57- SnippetsPanel snippetsTab = new SnippetsPanel (createFramework (createStorageEngineWithData ()));
58- snippetsTab .disableButtonsForSnippet ();
59- assertSnippetButtonsEnabledAre (snippetsTab , false );
60- snippetsTab .enableButtonsForSnippet ();
61- assertSnippetButtonsEnabledAre (snippetsTab , true );
56+ SnippetsPanel snippetsPanel = new SnippetsPanel (createFramework (createStorageEngineWithData ()));
57+ snippetsPanel .disableButtonsForSnippet ();
58+ assertSnippetButtonsEnabledAre (snippetsPanel , false );
59+ snippetsPanel .enableButtonsForSnippet ();
60+ assertSnippetButtonsEnabledAre (snippetsPanel , true );
6261 }
6362
6463 @ Test
@@ -72,11 +71,11 @@ public void testCreateEmptySnippet() throws Exception {
7271 assertEquals (expectedSnippet , framework .getData ().createEmptySnippetWithLastLanguage ());
7372 }
7473
75- private void assertSnippetButtonsEnabledAre (SnippetsPanel snippetsTab , boolean flag ) {
76- assertEquals (flag , snippetsTab .editSnippetButton .isEnabled ());
77- assertEquals (flag , snippetsTab .deleteSnippetButton .isEnabled ());
78- assertEquals (flag , snippetsTab .copyButton .isEnabled ());
79- assertEquals (flag , snippetsTab .openInBrowser .isEnabled ());
74+ private void assertSnippetButtonsEnabledAre (SnippetsPanel snippetsPanel , boolean flag ) {
75+ assertEquals (flag , snippetsPanel .editSnippetButton .isEnabled ());
76+ assertEquals (flag , snippetsPanel .deleteSnippetButton .isEnabled ());
77+ assertEquals (flag , snippetsPanel .copyButton .isEnabled ());
78+ assertEquals (flag , snippetsPanel .openInBrowser .isEnabled ());
8079 }
8180
8281}
0 commit comments