@Test public void isValueMissingForMandatoryParameterCheckTestListParameterMultipleSelectionNotListValue() { when( listParameterMock.isMandatory() ).thenReturn( true ); when( listParameterMock.isAllowMultiSelection() ).thenReturn( true ); assertFalse( validator.isValueMissingForMandatoryParameterCheck( listParameterMock, "value" ) ); }
@VisibleForTesting boolean isValueMissingForMandatoryParameterCheck( final ParameterDefinitionEntry entry, final Object computedValue ) { if ( entry.isMandatory() == false ) { return false; } if ( computedValue == null ) { return true; } if ( entry instanceof ListParameter ) { final ListParameter listParameter = (ListParameter) entry; if ( listParameter.isAllowMultiSelection() ) { if ( computedValue instanceof Object[] == false ) { return false; } else if ( Array.getLength( computedValue ) == 0 ) { return true; } } } return false; }
DefaultReportParameterValidator implements ReportParameterValidator { @VisibleForTesting boolean isValueMissingForMandatoryParameterCheck( final ParameterDefinitionEntry entry, final Object computedValue ) { if ( entry.isMandatory() == false ) { return false; } if ( computedValue == null ) { return true; } if ( entry instanceof ListParameter ) { final ListParameter listParameter = (ListParameter) entry; if ( listParameter.isAllowMultiSelection() ) { if ( computedValue instanceof Object[] == false ) { return false; } else if ( Array.getLength( computedValue ) == 0 ) { return true; } } } return false; } }
DefaultReportParameterValidator implements ReportParameterValidator { @VisibleForTesting boolean isValueMissingForMandatoryParameterCheck( final ParameterDefinitionEntry entry, final Object computedValue ) { if ( entry.isMandatory() == false ) { return false; } if ( computedValue == null ) { return true; } if ( entry instanceof ListParameter ) { final ListParameter listParameter = (ListParameter) entry; if ( listParameter.isAllowMultiSelection() ) { if ( computedValue instanceof Object[] == false ) { return false; } else if ( Array.getLength( computedValue ) == 0 ) { return true; } } } return false; } DefaultReportParameterValidator(); }
DefaultReportParameterValidator implements ReportParameterValidator { @VisibleForTesting boolean isValueMissingForMandatoryParameterCheck( final ParameterDefinitionEntry entry, final Object computedValue ) { if ( entry.isMandatory() == false ) { return false; } if ( computedValue == null ) { return true; } if ( entry instanceof ListParameter ) { final ListParameter listParameter = (ListParameter) entry; if ( listParameter.isAllowMultiSelection() ) { if ( computedValue instanceof Object[] == false ) { return false; } else if ( Array.getLength( computedValue ) == 0 ) { return true; } } } return false; } DefaultReportParameterValidator(); ValidationResult validate( ValidationResult result, final ReportParameterDefinition parameterDefinition,
      final ParameterContext parameterContext ); }
DefaultReportParameterValidator implements ReportParameterValidator { @VisibleForTesting boolean isValueMissingForMandatoryParameterCheck( final ParameterDefinitionEntry entry, final Object computedValue ) { if ( entry.isMandatory() == false ) { return false; } if ( computedValue == null ) { return true; } if ( entry instanceof ListParameter ) { final ListParameter listParameter = (ListParameter) entry; if ( listParameter.isAllowMultiSelection() ) { if ( computedValue instanceof Object[] == false ) { return false; } else if ( Array.getLength( computedValue ) == 0 ) { return true; } } } return false; } DefaultReportParameterValidator(); ValidationResult validate( ValidationResult result, final ReportParameterDefinition parameterDefinition,
      final ParameterContext parameterContext );  }