From testng documentation, this is how @optional is used.
@Parameters("db")
@Test
public void testNonExistentParameter(@Optional("mysql") String db) { ... }
If no parameter named "db" is found in your testng.xml file, your test method will receive the default value specified inside the @Optional annotation: "mysql".
Try by correcting your code accordingly. I think that should resolve the issue. If it still doesn't then declare the parameters at the suite tag level in testng.xml and test it.