OpenFlashChartComponent extends ComponentBase { protected boolean validateAction() { if ( !isDefinedInput( CHART_DATA ) ) { inputMissingError( CHART_DATA ); return false; } if ( !isDefinedInput( CHART_ATTRIBUTES ) ) { if ( !isDefinedResource( CHART_ATTRIBUTES ) ) { inputMissingError( CHART_ATTRIBUTES ); return false; } } return true; } OpenFlashChartComponent(); void done(); boolean init(); boolean validateSystemSettings(); Log getLogger(); @Override void inputMissingError( String paramName ); static String CHART_NODE_LOC; }
@Test public void testValidateAction() throws Exception { OpenFlashChartComponent fcc = spy( flashChartComponent ); doReturn( true ).when( fcc ).isDefinedInput( "chart-data" ); doReturn( false ).when( fcc ).isDefinedInput( "chart-attributes" ); doReturn( true ).when( fcc ).isDefinedResource( "chart-attributes" ); assertTrue( fcc.validateAction() ); }