@@ -36,61 +36,61 @@ class EpfStorageTest
36
36
@ BeforeEach
37
37
void before ()
38
38
{
39
- storage = new Storage ();
39
+ this . storage = new Storage ();
40
40
41
- storage .setActions (new HashSet <>( ));
42
- storage .setInclusions (new HashSet <>());
43
- storage .setExclusions (new HashSet <>());
41
+ this . storage .setActions (EnumSet . noneOf ( Action . class ));
42
+ this . storage .setInclusions (new HashSet <>());
43
+ this . storage .setExclusions (new HashSet <>());
44
44
45
- storage .getActions ().add (activate );
46
- storage .getActions ().add (reformat );
47
- storage .getActions ().add (reformatChangedCode );
48
- storage .getActions ().add (fieldCanBeFinal );
49
- storage .getActions ().add (missingOverrideAnnotation );
50
- storage .getActions ().add (unnecessarySemicolon );
45
+ this . storage .getActions ().add (activate );
46
+ this . storage .getActions ().add (reformat );
47
+ this . storage .getActions ().add (reformatChangedCode );
48
+ this . storage .getActions ().add (fieldCanBeFinal );
49
+ this . storage .getActions ().add (missingOverrideAnnotation );
50
+ this . storage .getActions ().add (unnecessarySemicolon );
51
51
52
- storage .getInclusions ().add ("inclusion1" );
53
- storage .getInclusions ().add ("inclusion2" );
52
+ this . storage .getInclusions ().add ("inclusion1" );
53
+ this . storage .getInclusions ().add ("inclusion2" );
54
54
55
- storage .getExclusions ().add ("exclusion1" );
56
- storage .getExclusions ().add ("exclusion2" );
55
+ this . storage .getExclusions ().add ("exclusion1" );
56
+ this . storage .getExclusions ().add ("exclusion2" );
57
57
}
58
58
59
59
@ Test
60
60
void should_storage_with_bad_configuration_path_returns_default_storage ()
61
61
{
62
62
Storage epfStorage ;
63
63
64
- epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (storage .getConfigurationPath (), storage );
65
- assertThat (storage ).isSameAs (epfStorage );
64
+ epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (this . storage .getConfigurationPath (), this . storage );
65
+ assertThat (this . storage ).isSameAs (epfStorage );
66
66
67
- storage .setConfigurationPath ("bad path" );
68
- epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (storage .getConfigurationPath (), storage );
69
- assertThat (storage ).isSameAs (epfStorage );
67
+ this . storage .setConfigurationPath ("bad path" );
68
+ epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (this . storage .getConfigurationPath (), this . storage );
69
+ assertThat (this . storage ).isSameAs (epfStorage );
70
70
}
71
71
72
72
@ Test
73
73
void should_default_storage_values_are_copied_to_epf_storage_if_empty_file ()
74
74
{
75
- Storage epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (EXAMPLE_EPF_0 .toString (), storage );
76
- assertThat (epfStorage ).isNotSameAs (storage );
75
+ final Storage epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (EXAMPLE_EPF_0 .toString (), this . storage );
76
+ assertThat (epfStorage ).isNotSameAs (this . storage );
77
77
78
- assertThat (epfStorage .getActions ()).isNotSameAs (storage .getActions ());
79
- assertThat (epfStorage .getInclusions ()).isNotSameAs (storage .getInclusions ());
80
- assertThat (epfStorage .getExclusions ()).isNotSameAs (storage .getExclusions ());
78
+ assertThat (epfStorage .getActions ()).isNotSameAs (this . storage .getActions ());
79
+ assertThat (epfStorage .getInclusions ()).isNotSameAs (this . storage .getInclusions ());
80
+ assertThat (epfStorage .getExclusions ()).isNotSameAs (this . storage .getExclusions ());
81
81
82
- assertThat (epfStorage .getActions ()).isEqualTo (storage .getActions ());
83
- assertThat (epfStorage .getInclusions ()).isEqualTo (storage .getInclusions ());
84
- assertThat (epfStorage .getExclusions ()).isEqualTo (storage .getExclusions ());
82
+ assertThat (epfStorage .getActions ()).isEqualTo (this . storage .getActions ());
83
+ assertThat (epfStorage .getInclusions ()).isEqualTo (this . storage .getInclusions ());
84
+ assertThat (epfStorage .getExclusions ()).isEqualTo (this . storage .getExclusions ());
85
85
}
86
86
87
87
@ Test
88
88
void should_storage_values_are_correct_for_file_format_1 ()
89
89
{
90
- Storage epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (EXAMPLE_EPF_1 .toString (), storage );
91
- assertThat (epfStorage ).isNotSameAs (storage );
90
+ final Storage epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (EXAMPLE_EPF_1 .toString (), this . storage );
91
+ assertThat (epfStorage ).isNotSameAs (this . storage );
92
92
93
- EnumSet <Action > expected = EnumSet .of (
93
+ final EnumSet <Action > expected = EnumSet .of (
94
94
// from default store (not in java)
95
95
activate ,
96
96
// in both store
@@ -116,17 +116,17 @@ void should_storage_values_are_correct_for_file_format_1()
116
116
);
117
117
118
118
assertThat (epfStorage .getActions ()).isEqualTo (expected );
119
- assertThat (epfStorage .getInclusions ()).isEqualTo (storage .getInclusions ());
120
- assertThat (epfStorage .getExclusions ()).isEqualTo (storage .getExclusions ());
119
+ assertThat (epfStorage .getInclusions ()).isEqualTo (this . storage .getInclusions ());
120
+ assertThat (epfStorage .getExclusions ()).isEqualTo (this . storage .getExclusions ());
121
121
}
122
122
123
123
@ Test
124
124
void should_storage_values_are_correct_for_file_format_2 ()
125
125
{
126
- Storage epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (EXAMPLE_EPF_2 .toString (), storage );
127
- assertThat (epfStorage ).isNotSameAs (storage );
126
+ final Storage epfStorage = EpfStorage .INSTANCE .getStorageOrDefault (EXAMPLE_EPF_2 .toString (), this . storage );
127
+ assertThat (epfStorage ).isNotSameAs (this . storage );
128
128
129
- EnumSet <Action > expected = EnumSet .of (
129
+ final EnumSet <Action > expected = EnumSet .of (
130
130
missingOverrideAnnotation ,
131
131
unnecessarySemicolon ,
132
132
rearrange ,
@@ -141,7 +141,7 @@ void should_storage_values_are_correct_for_file_format_2()
141
141
);
142
142
143
143
assertThat (epfStorage .getActions ()).isEqualTo (expected );
144
- assertThat (epfStorage .getInclusions ()).isEqualTo (storage .getInclusions ());
145
- assertThat (epfStorage .getExclusions ()).isEqualTo (storage .getExclusions ());
144
+ assertThat (epfStorage .getInclusions ()).isEqualTo (this . storage .getInclusions ());
145
+ assertThat (epfStorage .getExclusions ()).isEqualTo (this . storage .getExclusions ());
146
146
}
147
147
}
0 commit comments