Skip to content
Advertisement

Using attributes of one class in another class

I am trying to move the assertThat method from Authentication class to the BDDStyledMethod class but the current code will generate the following error “‘Creds(java.lang.String)’ in ‘steps.Authentication’ cannot be applied to ‘()'”

How do i correct my code so that the assertThat method works in the BDDStyledMethod class ?

JavaScript
JavaScript

Advertisement

Answer

The problem is with the Creds method. It is not returning anything and the exception is raised in this line -> Authentication.Creds().response.statusLine()
We can return a string from Creds method and then try to apply assert() on the returned string in GetActivityById class.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement