File tree Expand file tree Collapse file tree 4 files changed +3
-36
lines changed
main/java/org/apache/cloudstack/framework/extensions
test/java/org/apache/cloudstack/framework/extensions/dao Expand file tree Collapse file tree 4 files changed +3
-36
lines changed Original file line number Diff line number Diff line change 16
16
// under the License.
17
17
package org .apache .cloudstack .framework .extensions .dao ;
18
18
19
- import java . util . List ;
19
+ import org . apache . cloudstack . framework . extensions . vo . ExtensionVO ;
20
20
21
21
import com .cloud .utils .db .GenericDao ;
22
- import org .apache .cloudstack .framework .extensions .vo .ExtensionVO ;
23
22
24
23
public interface ExtensionDao extends GenericDao <ExtensionVO , Long > {
25
24
26
25
ExtensionVO findByName (String name );
27
- List <ExtensionVO > listAllEnabled ();
28
26
}
Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .cloudstack .framework .extensions .dao ;
19
19
20
- import java . util . List ;
20
+ import org . apache . cloudstack . framework . extensions . vo . ExtensionVO ;
21
21
22
22
import com .cloud .utils .db .GenericDaoBase ;
23
23
import com .cloud .utils .db .SearchBuilder ;
24
24
import com .cloud .utils .db .SearchCriteria ;
25
25
26
- import org .apache .cloudstack .extension .Extension ;
27
- import org .apache .cloudstack .framework .extensions .vo .ExtensionVO ;
28
-
29
26
public class ExtensionDaoImpl extends GenericDaoBase <ExtensionVO , Long > implements ExtensionDao {
30
27
31
28
private final SearchBuilder <ExtensionVO > AllFieldSearch ;
@@ -45,11 +42,4 @@ public ExtensionVO findByName(String name) {
45
42
46
43
return findOneBy (sc );
47
44
}
48
-
49
- @ Override
50
- public List <ExtensionVO > listAllEnabled () {
51
- SearchCriteria <ExtensionVO > sc = AllFieldSearch .create ();
52
- sc .setParameters ("state" , Extension .State .Enabled );
53
- return listBy (sc );
54
- }
55
45
}
Original file line number Diff line number Diff line change @@ -1516,7 +1516,7 @@ protected void runCleanupForLongestRunningManagementServer() {
1516
1516
logger .debug ("Skipping the extensions entrypoint sync check on this management server" );
1517
1517
return ;
1518
1518
}
1519
- List <ExtensionVO > extensions = extensionDao .listAllEnabled ();
1519
+ List <ExtensionVO > extensions = extensionDao .listAll ();
1520
1520
for (ExtensionVO extension : extensions ) {
1521
1521
checkExtensionEntryPointSync (extension , msHosts );
1522
1522
}
Original file line number Diff line number Diff line change 19
19
20
20
import static org .junit .Assert .assertEquals ;
21
21
import static org .junit .Assert .assertNull ;
22
- import static org .junit .Assert .assertTrue ;
23
22
import static org .mockito .Mockito .mock ;
24
23
import static org .mockito .Mockito .when ;
25
24
26
- import java .util .List ;
27
-
28
- import org .apache .cloudstack .extension .Extension ;
29
25
import org .apache .cloudstack .framework .extensions .vo .ExtensionVO ;
30
26
import org .junit .Before ;
31
27
import org .junit .Test ;
@@ -52,21 +48,4 @@ public void findByNameReturnsCorrectEntity() {
52
48
when (dao .findByName ("extensionName" )).thenReturn (expected );
53
49
assertEquals (expected , dao .findByName ("extensionName" ));
54
50
}
55
-
56
- @ Test
57
- public void listAllEnabledReturnsEmptyListWhenNoEnabledExtensions () {
58
- when (dao .listAllEnabled ()).thenReturn (List .of ());
59
- assertTrue (dao .listAllEnabled ().isEmpty ());
60
- }
61
-
62
- @ Test
63
- public void listAllEnabledReturnsCorrectEntities () {
64
- ExtensionVO enabled1 = new ExtensionVO ();
65
- enabled1 .setState (Extension .State .Enabled );
66
- ExtensionVO enabled2 = new ExtensionVO ();
67
- enabled2 .setState (Extension .State .Enabled );
68
- List <ExtensionVO > expected = List .of (enabled1 , enabled2 );
69
- when (dao .listAllEnabled ()).thenReturn (expected );
70
- assertEquals (expected , dao .listAllEnabled ());
71
- }
72
51
}
You can’t perform that action at this time.
0 commit comments