Google Code-In Task: https://codein.withgoogle.com/tasks/5400418718842880/ GitHub Issue: https://github.com/jboss-outreach/compressor-head-android/issues/16
The objective is to write tests for https://github.com/jboss-outreach/compressor-head-android/blob/master/app/src/main/java/com/community/jboss/compressorhead/utils/CompressorHead.java using JUnit. The problem is that some of the code to be tested is not mocked, which gives the following error when running the with JUnit: Method scheme in android.net.Uri$Builder not mocked. See http://g.co/androidstudio/not-mocked for details. The android.jar file that is used to run unit tests does not contain any actual code - that is provided by the Android system image on real devices. Instead, all methods throw exceptions (by default). This is to make sure your unit tests only test your code and do not depend on any particular behaviour of the Android platform (that you have not explicitly mocked e.g. using Mockito). Although, everything works when calling the tests from the Activity, I expect the automated JUnit testing to fail. -- You received this message because you are subscribed to the Google Groups "Google Code-in Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/gci-discuss. For more options, visit https://groups.google.com/d/optout.
