@Test public void processWithInaccessibleStudyReturnsPreviousConfigurationUnchanged() throws ComponentLookupException, XWikiException { when(this.xwiki.getDocument(any(DocumentReference.class), any(XWikiContext.class))) .thenReturn(null); Assert.assertSame(this.config, this.mocker.getComponentUnderTest().process(this.config)); verifyZeroInteractions(this.config); }
@Override public RecordConfiguration process(RecordConfiguration config) { if (config == null) { return null; } final StudyConfiguration configObj = getBoundConfiguration(); if (configObj == null) { return config; } String customPhenotypeMapping = configObj.getPhenotypeMapping(); if (StringUtils.isNotBlank(customPhenotypeMapping)) { config.setPhenotypeMapping(this.referenceParser.resolve(customPhenotypeMapping)); } final List<String> sectionOverrides = configObj.getSectionsOverride(); final List<String> fieldOverrides = configObj.getFieldsOverride(); if (CollectionUtils.isEmpty(sectionOverrides) || CollectionUtils.isEmpty(fieldOverrides)) { return config; } updateStudyConfiguration(config, sectionOverrides, fieldOverrides); return config; }
StudyRecordConfigurationModule implements RecordConfigurationModule { @Override public RecordConfiguration process(RecordConfiguration config) { if (config == null) { return null; } final StudyConfiguration configObj = getBoundConfiguration(); if (configObj == null) { return config; } String customPhenotypeMapping = configObj.getPhenotypeMapping(); if (StringUtils.isNotBlank(customPhenotypeMapping)) { config.setPhenotypeMapping(this.referenceParser.resolve(customPhenotypeMapping)); } final List<String> sectionOverrides = configObj.getSectionsOverride(); final List<String> fieldOverrides = configObj.getFieldsOverride(); if (CollectionUtils.isEmpty(sectionOverrides) || CollectionUtils.isEmpty(fieldOverrides)) { return config; } updateStudyConfiguration(config, sectionOverrides, fieldOverrides); return config; } }
StudyRecordConfigurationModule implements RecordConfigurationModule { @Override public RecordConfiguration process(RecordConfiguration config) { if (config == null) { return null; } final StudyConfiguration configObj = getBoundConfiguration(); if (configObj == null) { return config; } String customPhenotypeMapping = configObj.getPhenotypeMapping(); if (StringUtils.isNotBlank(customPhenotypeMapping)) { config.setPhenotypeMapping(this.referenceParser.resolve(customPhenotypeMapping)); } final List<String> sectionOverrides = configObj.getSectionsOverride(); final List<String> fieldOverrides = configObj.getFieldsOverride(); if (CollectionUtils.isEmpty(sectionOverrides) || CollectionUtils.isEmpty(fieldOverrides)) { return config; } updateStudyConfiguration(config, sectionOverrides, fieldOverrides); return config; }  }
StudyRecordConfigurationModule implements RecordConfigurationModule { @Override public RecordConfiguration process(RecordConfiguration config) { if (config == null) { return null; } final StudyConfiguration configObj = getBoundConfiguration(); if (configObj == null) { return config; } String customPhenotypeMapping = configObj.getPhenotypeMapping(); if (StringUtils.isNotBlank(customPhenotypeMapping)) { config.setPhenotypeMapping(this.referenceParser.resolve(customPhenotypeMapping)); } final List<String> sectionOverrides = configObj.getSectionsOverride(); final List<String> fieldOverrides = configObj.getFieldsOverride(); if (CollectionUtils.isEmpty(sectionOverrides) || CollectionUtils.isEmpty(fieldOverrides)) { return config; } updateStudyConfiguration(config, sectionOverrides, fieldOverrides); return config; }  @Override RecordConfiguration process(RecordConfiguration config); @Override int getPriority(); @Override boolean supportsRecordType(String recordType); }
StudyRecordConfigurationModule implements RecordConfigurationModule { @Override public RecordConfiguration process(RecordConfiguration config) { if (config == null) { return null; } final StudyConfiguration configObj = getBoundConfiguration(); if (configObj == null) { return config; } String customPhenotypeMapping = configObj.getPhenotypeMapping(); if (StringUtils.isNotBlank(customPhenotypeMapping)) { config.setPhenotypeMapping(this.referenceParser.resolve(customPhenotypeMapping)); } final List<String> sectionOverrides = configObj.getSectionsOverride(); final List<String> fieldOverrides = configObj.getFieldsOverride(); if (CollectionUtils.isEmpty(sectionOverrides) || CollectionUtils.isEmpty(fieldOverrides)) { return config; } updateStudyConfiguration(config, sectionOverrides, fieldOverrides); return config; }  @Override RecordConfiguration process(RecordConfiguration config); @Override int getPriority(); @Override boolean supportsRecordType(String recordType); static final EntityReference STUDY_CLASS_REFERENCE; static final EntityReference STUDY_BINDING_CLASS_REFERENCE; static final String STUDY_REFERENCE_PROPERTY_LABEL; }