Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to mock ResourceResponse<Document> #132

Open
shubhamsxn65 opened this issue May 13, 2019 · 0 comments
Open

How to mock ResourceResponse<Document> #132

shubhamsxn65 opened this issue May 13, 2019 · 0 comments

Comments

@shubhamsxn65
Copy link

There are no constructors provided for mocking ResourceResponse purpose? Is this a feature planned? Are there any alternatives as of now?

On running the below code.

@Test
  def createDatabaseTest(): Unit = {
    var database : Database = new Database()
    database.setId("randomName")
    when(documentClient.createDatabase(any(classOf[Database]), any(classOf[RequestOptions]))).thenReturn(new ResourceResponse[Database](database))
    
    cosmosDbClient.createDatabase("randomName", null)
  }

I am getting this exception:

Error:(34, 106) constructor ResourceResponse in class ResourceResponse cannot be accessed in class CosmosDbClientTest
    when(documentClient.createDatabase(any(classOf[Database]), any(classOf[RequestOptions]))).thenReturn(new ResourceResponse[Database](database))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant