Questions tagged [java-test-fixtures]

19 questions
0
votes
1 answer

Can't get test fixtures to work in gradle

I've been using these answers to try to get a test class to be visible from subproject ":A:B" to ":A:C": (https://discuss.gradle.org/t/gradle-test-classes-needed-in-another-sub-project/13365/2) (Multi-project test dependencies with gradle) using…
0
votes
1 answer

gradle testFixturesImplementation cannot find symbol Mockito

I am trying to set up testFixtures. I have a class that until now was in src/test/ and now I'm trying to turn it into fixrure. In build.gradle I added: plugins { id 'java-library' id "java-test-fixtures" } I moved the class from…
Gavriel
  • 18,880
  • 12
  • 68
  • 105
0
votes
1 answer

How to mock "new" created objects inside a method in Mockito

I have a legacy code where the code looks like below : public String getToken() { HttpURLConnection urlConnection = (HttpURLConnection)(new URL(endpoint).getConnection(); .. } How to mock a new URL(endpoint).getConnection(). Until I get a mocked…
Nilotpal
  • 3,237
  • 4
  • 34
  • 56
1
2