Got java.lang.IllegalArgumentException when using data provider pass in TestNG -
here part of data provider method:
@dataprovider (name = "dataprovider1") public static object[][] dataprovider1() { return new object[][] { // total sale 0.00 { new object[][]{{msoecommissioncalculator.replacemnet_item, 0.00}, {msoecommissioncalculator.replacemnet_item, 0.00}, {msoecommissioncalculator.replacemnet_item, 0.00}, {msoecommissioncalculator.replacemnet_item, 0.00}, {msoecommissioncalculator.consulting_item, 0.00}, {msoecommissioncalculator.maintenance_item, 0.00}, {msoecommissioncalculator.basic_item, 0.00}, {msoecommissioncalculator.maintenance_item, 0.00}}, 0.00 },
when use data provider like:
@test (dataprovider = "dataprovider1", dataproviderclass = msoecommissioncalculatortestdataprovider.class) public void testforprobationary(object[][] sales, float assertcommission) { }
this generates following error:
failed: testforprobationary([[ljava.lang.object;@380fb434, 0.0) java.lang.illegalargumentexception: argument type mismatch
0.00 double, not float. use 0 or 0.00f instead.