2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.restconf.rest.services.impl;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
12 import static org.junit.Assert.assertTrue;
13 import static org.junit.Assert.fail;
14 import static org.mockito.Mockito.mock;
15 import static org.mockito.Mockito.spy;
16 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.ALLOWED_KEYWORDS;
17 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.MOUNT_POINT;
18 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.NOT_EXISTING_MODULE;
19 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.NOT_EXISTING_MODULE_BEHIND_MOUNT_POINT;
20 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.NOT_REGISTERED_MOUNT_POINT;
21 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.TEST_MODULE;
22 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.TEST_MODULE_BEHIND_MOUNT_POINT;
23 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.TEST_MODULE_BEHIND_NOT_REGISTERED_MOUNT_POINT;
24 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.getExpectedModules;
25 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.getExpectedModulesBehindMountPoint;
26 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.setupCustomRestconfModule;
27 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.setupCustomRestconfModuleMountPoint;
28 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.setupMissingRestconfModule;
29 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.setupMissingRestconfModuleMountPoint;
30 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.setupNormal;
31 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.setupNormalMountPoint;
32 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.setupNullMountPointService;
33 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.verifyModule;
34 import static org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.verifyModules;
36 import java.util.AbstractMap.SimpleImmutableEntry;
37 import java.util.Collection;
38 import java.util.Collections;
39 import java.util.HashSet;
40 import java.util.Iterator;
41 import java.util.Map.Entry;
43 import org.junit.Rule;
44 import org.junit.Test;
45 import org.junit.rules.ExpectedException;
46 import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
47 import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
48 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
49 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
50 import org.opendaylight.restconf.Draft15.RestconfModule;
51 import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
52 import org.opendaylight.restconf.handlers.SchemaContextHandler;
53 import org.opendaylight.restconf.rest.services.api.RestconfModulesService;
54 import org.opendaylight.restconf.rest.services.impl.RestconfModulesServiceTestUtils.TestModule;
55 import org.opendaylight.restconf.utils.RestconfConstants;
56 import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeConstants;
57 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
58 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
59 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
60 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
61 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
62 import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerAttrNode;
63 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
64 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
67 * Unit tests of the {@link RestconfModulesServiceImpl}
70 public class RestconfModulesServiceTest {
71 @Rule public ExpectedException thrown = ExpectedException.none();
74 * Test non-null init of {@link RestconfModulesServiceImpl}.
77 public void restconfModulesServiceImplInitTest() {
78 assertNotNull("Modules service should be initialized and not null",
79 new RestconfModulesServiceImpl(mock(SchemaContextHandler.class),
80 mock(DOMMountPointServiceHandler.class)));
84 * Test getting all modules supported by the server. Retrieved modules are verified by the name, namespace and
88 public void getModulesTest() throws Exception {
89 // load schema context with testing modules and correct Restconf module
90 final RestconfModulesService modulesService = setupNormal();
93 final NormalizedNodeContext nodeContext = modulesService.getModules(null);
95 // check if expected modules were loaded
96 assertNotNull("Node context cannot be null", nodeContext);
97 final Collection<?> modules = (Collection<?>) ((ContainerNode) nodeContext .getData())
98 .getValue().iterator().next().getValue();
99 final Set<TestModule> loadedModules = new HashSet<>();
101 for (final Object node : modules) {
102 final Iterator mapEntries = ((AbstractImmutableDataContainerAttrNode) node).getChildren().entrySet()
104 final TestModule loadedModule = new TestModule();
106 while (mapEntries.hasNext()) {
107 final Entry e = ((SimpleImmutableEntry) mapEntries.next());
108 final String key = ((NodeIdentifier) e.getKey()).getNodeType().getLocalName();
110 assertTrue("Not allowed keyword", ALLOWED_KEYWORDS.contains(key));
113 case RestconfMappingNodeConstants.NAME:
114 loadedModule.setName((String) ((LeafNode) e.getValue()).getValue());
116 case RestconfMappingNodeConstants.NAMESPACE:
117 loadedModule.setNamespace((String) ((LeafNode) e.getValue()).getValue());
119 case RestconfMappingNodeConstants.REVISION:
120 loadedModule.setRevision((String) ((LeafNode) e.getValue()).getValue());
122 case RestconfMappingNodeConstants.FEATURE:
127 loadedModules.add(loadedModule);
130 verifyModules(getExpectedModules(), loadedModules);
134 * Test getting all modules supported by the mount point. Retrieved modules are verified by the name, namespace and
138 public void getModulesMountPointTest() throws Exception {
139 // load testing modules and correct Restconf module behind mount point
140 final RestconfModulesService modulesService = setupNormalMountPoint();
143 final NormalizedNodeContext nodeContext = modulesService.getModules(MOUNT_POINT, null);
145 // check if expected modules were loaded, use module name as map key
146 assertNotNull("Node context cannot be null", nodeContext);
147 final Collection<?> modules = (Collection<?>) ((ContainerNode) nodeContext .getData())
148 .getValue().iterator().next().getValue();
149 final Set<TestModule> loadedModules = new HashSet<>();
151 for (final Object node : modules) {
152 final Iterator mapEntries = ((AbstractImmutableDataContainerAttrNode) node).getChildren().entrySet()
154 final TestModule loadedModule = new TestModule();
156 while (mapEntries.hasNext()) {
157 final Entry e = ((SimpleImmutableEntry) mapEntries.next());
158 final String key = ((NodeIdentifier) e.getKey()).getNodeType().getLocalName();
160 assertTrue("Not allowed keyword", ALLOWED_KEYWORDS.contains(key));
163 case RestconfMappingNodeConstants.NAME:
164 loadedModule.setName((String) ((LeafNode) e.getValue()).getValue());
166 case RestconfMappingNodeConstants.NAMESPACE:
167 loadedModule.setNamespace((String) ((LeafNode) e.getValue()).getValue());
169 case RestconfMappingNodeConstants.REVISION:
170 loadedModule.setRevision((String) ((LeafNode) e.getValue()).getValue());
172 case RestconfMappingNodeConstants.FEATURE:
177 loadedModules.add(loadedModule);
180 verifyModules(getExpectedModulesBehindMountPoint(), loadedModules);
184 * Test getting the specific module supported by the server. Module name, revision, namespace and features are
185 * compared to have expected values.
188 public void getModuleTest() throws Exception {
190 final RestconfModulesService modulesService = setupNormal();
193 final NormalizedNodeContext nodeContext = modulesService.getModule(TEST_MODULE, null);
195 // verify loaded module
196 assertNotNull("Node context cannot be null", nodeContext);
197 final MapEntryNode node = ((MapNode) nodeContext.getData()).getValue().iterator().next();
198 final Iterator mapEntries = ((AbstractImmutableDataContainerAttrNode) node).getChildren().entrySet().iterator();
199 verifyModule("module1", "module:1", "2014-01-01", Collections.emptySet(), mapEntries);
203 * Test getting the specific module supported by the mount point.
206 public void getModuleMountPointTest() throws Exception {
208 final RestconfModulesService modulesService = setupNormalMountPoint();
210 // get test module schemaContextBehindMountPoint mount point
211 final NormalizedNodeContext nodeContext = modulesService.getModule(TEST_MODULE_BEHIND_MOUNT_POINT, null);
213 // verify loaded module
214 assertNotNull("Node context cannot be null", nodeContext);
215 final MapEntryNode node = ((MapNode) nodeContext.getData()).getValue().iterator().next();
216 final Iterator mapEntries = ((AbstractImmutableDataContainerAttrNode) node).getChildren().entrySet().iterator();
217 verifyModule("module1-behind-mount-point", "module:1:behind:mount:point", "2014-02-03",
218 Collections.emptySet(), mapEntries);
222 * Test getting all modules supported by the server if Restconf module is <code>null</code>. Test is expected to
223 * fail with <code>NullPointerException</code>.
226 public void getModulesWithoutRestconfModuleNegativeTest() throws Exception {
228 final RestconfModulesService modulesService = setupMissingRestconfModule();
231 this.thrown.expect(NullPointerException.class);
232 modulesService.getModules(null);
236 * Test getting all modules supported by the mount point if Restconf module is <code>null</code>. Test is expected
237 * to fail with <code>NullPointerException</code>.
240 public void getModulesWithoutRestconfModuleMountPointNegativeTest() throws Exception {
242 final RestconfModulesService modulesService = setupMissingRestconfModuleMountPoint();
245 this.thrown.expect(NullPointerException.class);
246 modulesService.getModules(MOUNT_POINT, null);
250 * Test getting all modules supported by the mount point with <code>null</code> value of
251 * identifier for mount point. Test is expected to fail with <code>NullPointerException</code>.
254 public void getModulesWithNullIdentifierOfMountPointNegativeTest() throws Exception {
256 final RestconfModulesService modulesService = setupNormalMountPoint();
259 this.thrown.expect(NullPointerException.class);
260 modulesService.getModules(null, null);
264 * Test getting all modules supported by the mount point if identifier does
265 * not contains {@link RestconfConstants#MOUNT}. Catching
266 * {@link RestconfDocumentedException} and testing error tyupe, error tag and error status code.
269 public void getModulesWithoutMountConstantInMountPointIdentifierNegativeTest() throws Exception {
271 final RestconfModulesService modulesService = setupNormalMountPoint();
274 modulesService.getModules(MOUNT_POINT.replace("/" + RestconfConstants.MOUNT + "/", ""), null);
275 fail("Test should fail due to missing " + RestconfConstants.MOUNT + " constant in mount point identifier");
276 } catch (final RestconfDocumentedException e) {
277 assertEquals("Error type is not correct", ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
278 assertEquals("Error tag is not correct", ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
279 assertEquals("Error status code is not correct", 400, e.getErrors().get(0).getErrorTag().getStatusCode());
284 * Test getting all modules supported by the server when Restconf module does not contain node with name
285 * {@link RestconfModule#MODULES_CONTAINER_SCHEMA_NODE}. Test is expected to fail with
286 * <code>RestconfDocumentedException</code> and error type, error tag and error status code are compared to
290 public void getModulesRestconfModuleWithMissingContainerModulesNegativeTest() throws Exception {
292 final RestconfModulesService modulesService = setupCustomRestconfModule(
293 "restconf-module-with-missing-container-modules");
297 modulesService.getModules(null);
298 fail("Test should fail due to missing " + RestconfModule.MODULES_CONTAINER_SCHEMA_NODE
299 + " node in Restconf module");
300 } catch (final RestconfDocumentedException e) {
301 assertEquals("Error type is not correct", ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
302 assertEquals("Error tag is not correct", ErrorTag.DATA_MISSING, e.getErrors().get(0).getErrorTag());
303 assertEquals("Error status code is not correct", 404, e.getErrors().get(0).getErrorTag().getStatusCode());
308 * Test getting all modules supported by the server when Restconf module contains node with name
309 * {@link RestconfModule#MODULES_CONTAINER_SCHEMA_NODE} but it is not of type {@link ContainerSchemaNode}. Test is
310 * expected to fail with <code>IllegalStateException</code>.
313 public void getModulesRestconfModuleWithIllegalContainerModulesNegativeTest() throws Exception {
315 final RestconfModulesService modulesService = setupCustomRestconfModule(
316 "restconf-module-with-illegal-container-modules");
319 this.thrown.expect(IllegalStateException.class);
320 modulesService.getModules(null);
324 * Test getting all modules supported by the mount point when Restconf module does not contain node with name
325 * {@link RestconfModule#MODULES_CONTAINER_SCHEMA_NODE}. Test is expected to fail with
326 * <code>RestconfDocumentedException</code> and error type, error tag and error status code are compared to
330 public void getModulesRestconfModuleWithMissingContainerModulesMountPointNegativeTest() throws Exception {
332 final RestconfModulesService modulesService = setupCustomRestconfModuleMountPoint(
333 "restconf-module-with-missing-container-modules");
336 modulesService.getModules(MOUNT_POINT, null);
337 fail("Test should fail due to missing " + RestconfModule.MODULES_CONTAINER_SCHEMA_NODE
338 + " node in Restconf module");
339 } catch (final RestconfDocumentedException e) {
340 assertEquals("Error type is not correct", ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
341 assertEquals("Error tag is not correct", ErrorTag.DATA_MISSING, e.getErrors().get(0).getErrorTag());
342 assertEquals("Error status code is not correct", 404, e.getErrors().get(0).getErrorTag().getStatusCode());
347 * Test getting all modules supported by the mount point when Restconf module contains node with name
348 * {@link RestconfModule#MODULES_CONTAINER_SCHEMA_NODE} but it is not of type {@link ContainerSchemaNode}. Test
349 * is expected to fail with <code>IllegalStateException</code>.
352 public void getModulesRestconfModuleWithIllegalContainerModulesMountPointNegativeTest() throws Exception {
354 final RestconfModulesService modulesService = setupCustomRestconfModuleMountPoint(
355 "restconf-module-with-illegal-container-modules");
358 this.thrown.expect(IllegalStateException.class);
359 modulesService.getModules(MOUNT_POINT, null);
363 * Test of getting specific module supported by the server/mount point with <code>null</code> identifier. Test is
364 * expected to fail with <code>NullPointerException</code>.
367 public void getModuleWithNullIdentifierNegativeTest() throws Exception {
369 final RestconfModulesService modulesService = spy(new RestconfModulesServiceImpl(
370 mock(SchemaContextHandler.class),
371 mock(DOMMountPointServiceHandler.class)));
374 this.thrown.expect(NullPointerException.class);
375 modulesService.getModule(null, null);
379 * Testing getting specific module supported by the server with module identifier which
380 * does not exist in <code>SchemaContext</code>. Catching {@link RestconfDocumentedException}
381 * and testing error type, error tag and error status code.
384 public void getModuleNotExistModuleNegativeTest() throws Exception {
386 final RestconfModulesService modulesService = setupNormal();
390 modulesService.getModule(NOT_EXISTING_MODULE, null);
391 fail("Test should fail due to searching for not-existing module");
392 } catch (final RestconfDocumentedException e) {
393 assertEquals("Error type is not correct", ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
394 assertEquals("Error tag is not correct", ErrorTag.UNKNOWN_ELEMENT, e.getErrors().get(0).getErrorTag());
395 assertEquals("Error code is not correct", 400, e.getErrors().get(0).getErrorTag().getStatusCode());
400 * Testing getting specific module supported by the mount point with module identifier which
401 * does not exist in <code>SchemaContext</code>. Catching {@link RestconfDocumentedException}
402 * and testing error type, error tag and error status code.
405 public void getModuleNotExistModuleMountPointNegativeTest() throws Exception {
407 final RestconfModulesService modulesService = setupNormalMountPoint();
411 modulesService.getModule(NOT_EXISTING_MODULE_BEHIND_MOUNT_POINT, null);
412 fail("Test should fail due to searching for not-existing module");
413 } catch (final RestconfDocumentedException e) {
414 assertEquals("Error type is not correct", ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
415 assertEquals("Error tag is not correct", ErrorTag.UNKNOWN_ELEMENT, e.getErrors().get(0).getErrorTag());
416 assertEquals("Error code is not correct", 400, e.getErrors().get(0).getErrorTag().getStatusCode());
421 * Test getting specific module supported by the server when Restconf module is null. Test is expected to fail
422 * with <code>NullPointerException</code>.
425 public void getModuleWithoutRestconfModuleNegativeTest() throws Exception {
426 // prepare conditions
427 final RestconfModulesService modulesService = setupMissingRestconfModule();
429 this.thrown.expect(NullPointerException.class);
430 modulesService.getModule(TEST_MODULE, null);
434 * Test getting specific module supported by the mount point when Restconf module is null. Test is expected to fail
435 * with <code>NullPointerException</code>.
438 public void getModuleWithoutRestconfModuleMountPointNegativeTest() throws Exception {
439 // prepare conditions
440 final RestconfModulesService modulesService = setupMissingRestconfModuleMountPoint();
442 this.thrown.expect(NullPointerException.class);
443 modulesService.getModule(TEST_MODULE_BEHIND_MOUNT_POINT, null);
447 * Test getting specific module supported by the server when Restconf module does not contain node with
448 * name {@link RestconfModule#MODULE_LIST_SCHEMA_NODE}. Test is expected to fail with
449 * <code>RestconfDocumentedException</code> and error type, error tag and error status code are compared to
453 public void getModuleRestconfModuleWithMissingListModuleNegativeTest() throws Exception {
455 final RestconfModulesService modulesService =
456 setupCustomRestconfModule("restconf-module-with-missing-list-module");
460 modulesService.getModule(TEST_MODULE, null);
461 fail("Test should fail due to missing " + RestconfModule.MODULE_LIST_SCHEMA_NODE
462 + " node in Restconf module");
463 } catch (final RestconfDocumentedException e) {
464 assertEquals("Error type is not correct", ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
465 assertEquals("Error tag is not correct", ErrorTag.DATA_MISSING, e.getErrors().get(0).getErrorTag());
466 assertEquals("Error code is not correct", 404, e.getErrors().get(0).getErrorTag().getStatusCode());
471 * Test getting specific module supported by the server when Restconf module contains node with name
472 * {@link RestconfModule#MODULE_LIST_SCHEMA_NODE} but it is not of type {@link ListSchemaNode}. Test is expected
473 * to fail with <code>IllegalStateException</code>.
476 public void getModuleRestconfModuleWitIllegalListSchemaNodeNegativeTest() throws Exception {
478 final RestconfModulesService modulesService = setupCustomRestconfModule(
479 "restconf-module-with-illegal-list-module");
482 this.thrown.expect(IllegalStateException.class);
483 modulesService.getModule(TEST_MODULE, null);
487 * Test getting specific module supported by the mount point when Restconf module does not contain node with
488 * name {@link RestconfModule#MODULE_LIST_SCHEMA_NODE}. Test is expected to fail with
489 * <code>RestconfDocumentedException</code> and error type, error tag and error status code are compared to
493 public void getModuleRestconfModuleWithMissingListModuleMountPointNegativeTest() throws Exception {
495 final RestconfModulesService modulesService =
496 setupCustomRestconfModuleMountPoint("restconf-module-with-missing-list-module");
500 modulesService.getModule(TEST_MODULE_BEHIND_MOUNT_POINT, null);
501 fail("Test should fail due to missing " + RestconfModule.MODULE_LIST_SCHEMA_NODE
502 + " node in Restconf module");
503 } catch (final RestconfDocumentedException e) {
504 assertEquals("Error type is not correct", ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
505 assertEquals("Error tag is not correct", ErrorTag.DATA_MISSING, e.getErrors().get(0).getErrorTag());
506 assertEquals("Error code is not correct", 404, e.getErrors().get(0).getErrorTag().getStatusCode());
511 * Test getting specific module supported by the mount point when Restconf module contains node with name
512 * {@link RestconfModule#MODULE_LIST_SCHEMA_NODE} but it is not of type {@link ListSchemaNode}. Test is expected
513 * to fail with <code>IllegalStateException</code>.
516 public void getModuleRestconfModuleWitIllegalListModuleMountPointNegativeTest() throws Exception {
518 final RestconfModulesService modulesService = setupCustomRestconfModuleMountPoint(
519 "restconf-module-with-illegal-list-module");
522 this.thrown.expect(IllegalStateException.class);
523 modulesService.getModule(TEST_MODULE_BEHIND_MOUNT_POINT, null);
527 * Negative test of specific module supported by the mount point when <code>DOMMountPointServiceHandler</code>
528 * contains <code>null</code> reference to <code>DOMMountPointService</code>. Test is expected to fail with
529 * <code>NullPointerException</code>.
532 public void getModuleMissingMountPointServiceNegativeTest() throws Exception {
533 // prepare conditions
534 final RestconfModulesService modulesService = setupNullMountPointService();
537 this.thrown.expect(NullPointerException.class);
538 modulesService.getModule(TEST_MODULE_BEHIND_MOUNT_POINT, null);
542 * Negative test of getting all modules supported by the mount point when <code>DOMMountPointServiceHandler</code>
543 * contains <code>null</code> reference to <code>DOMMountPointService</code>. Test is expected to fail with
544 * <code>NullPointerException</code>.
547 public void getModulesMissingMountPointServiceNegativeTest() throws Exception {
548 // prepare conditions
549 final RestconfModulesService modulesService = setupNullMountPointService();
552 this.thrown.expect(NullPointerException.class);
553 modulesService.getModules(MOUNT_POINT, null);
557 * Negative test of getting specific module supported by the mount point when specified mount point is not found
558 * (it is not registered in <code>DOMMountPointService</code>). Test is expected to fail with
559 * <code>IllegalStateException</code>.
562 public void getModuleMountPointNotFoundNegativeTest() throws Exception {
563 // prepare conditions
564 final RestconfModulesService modulesService = setupNormalMountPoint();
567 this.thrown.expect(IllegalStateException.class);
568 modulesService.getModule(TEST_MODULE_BEHIND_NOT_REGISTERED_MOUNT_POINT, null);
572 * Negative test of getting all modules supported by the mount point when specified mount point is not found (it
573 * is not registered in <code>DOMMountPointService</code>). Test is expected to fail with
574 * <code>IllegalStateException</code>.
577 public void getModulesMountPointNotFoundNegativeTest() throws Exception {
578 // prepare conditions
579 final RestconfModulesService modulesService = setupNormalMountPoint();
582 this.thrown.expect(IllegalStateException.class);
583 modulesService.getModules(NOT_REGISTERED_MOUNT_POINT, null);