handstandsam / androidhttpmockingexamples Goto Github PK
View Code? Open in Web Editor NEW"androidTest" Examples for WireMock 2.x and okhttp MockWebServer 3.x
License: Apache License 2.0
"androidTest" Examples for WireMock 2.x and okhttp MockWebServer 3.x
License: Apache License 2.0
For some reason i can't even build the code on this repository.
It keeps giving me the following error:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebugAndroidTest'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
I download this project (AndroidHttpMockingExamples).
Import to Android Studio 2.3.
When start WireMockAndroidTest1.testWiremock() on Android 7.0 it work.
But when start WireMockAndroidTest1.testWiremock() on Android 4.3
I get error:
$ adb shell am instrument -w -r -e debug false -e class com.handstandsam.httpmocking.tests.wiremock.WireMockAndroidTest1#testWiremock weatherview.joshskeen.com.weatherview.test/android.support.test.runner.AndroidJUnitRunner
Client not ready yet..
Started running tests
Test running failed: Instrumentation run failed due to 'java.lang.NoClassDefFoundError'
Empty test suite.
Building the WireMock tests fails with
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebugAndroidTest'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
File1: /Users/ohad/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.8.0/45b426f7796b741035581a176744d91090e2e6fb/jackson-annotations-2.8.0.jar
File2: /Users/ohad/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.8.5/60d059f5d2930ccd1ef03535b713fd9f933d1ba7/jackson-core-2.8.5.jar
File3: /Users/ohad/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.8.5/b3035f37e674c04dafe36a660c3815cc59f764e2/jackson-databind-2.8.5.jar
I have fixed it by adding:
exclude group: 'com.fasterxml.jackson.core'
to WireMock build rule:
androidTestCompile("com.github.tomakehurst:wiremock:2.6.0") {
I configured Wiremock in my android application to simulate a file download. and I use Android DownloadManager to download the file. But I always receive an HTML response. Is it possible to access wiremock running in my application from a different application (for example Download Manager)?
Hi,
I trying to mock response by keeping files inside the project,But this line is not working and I cant get this.
String jsonBody = asset(activity, "atlanta-conditions.json");
What is that asset mentioned in this line.
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.