summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
1302ce8)
- rename leaf-list subscribers to subscriptionIds
- code using the same also updated
- not creating a new version of model as nobody is using it at the
moment
Issue-ID: CPS-2088
Change-Id: I43d679047bdfc665b56f262757acc4bbaba2733f
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
public class CmNotificationSubscriptionPersistenceServiceImpl implements CmNotificationSubscriptionPersistenceService {
private static final String IS_ONGOING_CM_SUBSCRIPTION_CPS_PATH_QUERY = """
public class CmNotificationSubscriptionPersistenceServiceImpl implements CmNotificationSubscriptionPersistenceService {
private static final String IS_ONGOING_CM_SUBSCRIPTION_CPS_PATH_QUERY = """
- /datastores/datastore[@name='%s']/cm-handles/cm-handle[@id='%s']/filters/filter[@xpath='%s']""";
+ /datastores/datastore[@name='%s']/cm-handles/cm-handle[@id='%s']/filters/filter[@xpath='%s']
+ """.trim();
private final CpsQueryService cpsQueryService;
private final CpsQueryService cpsQueryService;
if (existingNodes.isEmpty()) {
return Collections.emptyList();
}
if (existingNodes.isEmpty()) {
return Collections.emptyList();
}
- return (List<String>) existingNodes.iterator().next().getLeaves().get("subscribers");
+ return (List<String>) existingNodes.iterator().next().getLeaves().get("subscriptionIds");
}
private static String escapeQuotesByDoublingThem(final String inputXpath) {
}
private static String escapeQuotesByDoublingThem(final String inputXpath) {
@Service
public class CmDataSubscriptionModelLoader extends AbstractModelLoader {
@Service
public class CmDataSubscriptionModelLoader extends AbstractModelLoader {
- private static final String MODEL_FILENAME = "cm-data-subscriptions@2023-11-13.yang";
+ private static final String MODEL_FILENAME = "cm-data-subscriptions@2024-02-12.yang";
private static final String SCHEMASET_NAME = "cm-data-subscriptions";
private static final String ANCHOR_NAME = "cm-data-subscriptions";
private static final String REGISTRY_DATANODE_NAME = "datastores";
private static final String SCHEMASET_NAME = "cm-data-subscriptions";
private static final String ANCHOR_NAME = "cm-data-subscriptions";
private static final String REGISTRY_DATANODE_NAME = "datastores";
- revision "2023-11-13" {
+ revision "2024-02-12" {
description
"First release of cm data (notification) subscriptions model";
}
description
"First release of cm data (notification) subscriptions model";
}
- leaf-list subscribers {
+ leaf-list subscriptionIds {
then: 'we get expected response'
assert response == isOngoingCmSubscription
where: 'following scenarios are used'
then: 'we get expected response'
assert response == isOngoingCmSubscription
where: 'following scenarios are used'
- scenario | dataNode || isOngoingCmSubscription
- 'valid datanodes present' | [new DataNode(xpath: '/cps/path', leaves: ['subscribers': ['sub-1', 'sub-2']])] || true
- 'no datanodes present' | [] || false
+ scenario | dataNode || isOngoingCmSubscription
+ 'valid datanodes present' | [new DataNode(xpath: '/cps/path', leaves: ['subscriptionIds': ['sub-1', 'sub-2']])] || true
+ 'no datanodes present' | [] || false
def loggingListAppender
void setup() {
def loggingListAppender
void setup() {
- yangResourceToContentMap = objectUnderTest.createYangResourcesToContentMap('cm-data-subscriptions@2023-11-13.yang')
+ yangResourceToContentMap = objectUnderTest.createYangResourcesToContentMap('cm-data-subscriptions@2024-02-12.yang')
logger.setLevel(Level.DEBUG)
loggingListAppender = new ListAppender()
logger.addAppender(loggingListAppender)
logger.setLevel(Level.DEBUG)
loggingListAppender = new ListAppender()
logger.addAppender(loggingListAppender)
def 'Create schema set.'() {
when: 'creating a schema set'
def 'Create schema set.'() {
when: 'creating a schema set'
- objectUnderTest.createSchemaSet('some dataspace','new name','cm-data-subscriptions@2023-11-13.yang')
+ objectUnderTest.createSchemaSet('some dataspace','new name','cm-data-subscriptions@2024-02-12.yang')
then: 'the operation is delegated to the admin service'
1 * mockCpsModuleService.createSchemaSet('some dataspace','new name',_)
}
then: 'the operation is delegated to the admin service'
1 * mockCpsModuleService.createSchemaSet('some dataspace','new name',_)
}
given: 'the module service throws an already defined exception'
mockCpsModuleService.createSchemaSet(*_) >> { throw AlreadyDefinedException.forSchemaSet('name','context',null) }
when: 'attempt to create a schema set'
given: 'the module service throws an already defined exception'
mockCpsModuleService.createSchemaSet(*_) >> { throw AlreadyDefinedException.forSchemaSet('name','context',null) }
when: 'attempt to create a schema set'
- objectUnderTest.createSchemaSet('some dataspace','new name','cm-data-subscriptions@2023-11-13.yang')
+ objectUnderTest.createSchemaSet('some dataspace','new name','cm-data-subscriptions@2024-02-12.yang')
then: 'the exception is ignored i.e. no exception thrown up'
noExceptionThrown()
and: 'the exception message is logged'
then: 'the exception is ignored i.e. no exception thrown up'
noExceptionThrown()
and: 'the exception message is logged'
def loggingListAppender
void setup() {
def loggingListAppender
void setup() {
- expectedYangResourcesToContentMap = objectUnderTest.createYangResourcesToContentMap('cm-data-subscriptions@2023-11-13.yang')
+ expectedYangResourcesToContentMap = objectUnderTest.createYangResourcesToContentMap('cm-data-subscriptions@2024-02-12.yang')
logger.setLevel(Level.DEBUG)
loggingListAppender = new ListAppender()
logger.addAppender(loggingListAppender)
logger.setLevel(Level.DEBUG)
loggingListAppender = new ListAppender()
logger.addAppender(loggingListAppender)