This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject | |
lateinit var okHttp: OkHttpClient | |
private lateinit var okHttp3IdlingResource: OkHttp3IdlingResource | |
@Before | |
fun setup() { | |
hiltRule.inject() | |
okHttp3IdlingResource = OkHttp3IdlingResource.create("okhttp", okHttp) | |
IdlingRegistry.getInstance().register(okHttp3IdlingResource) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal inner class RequestDispatcher : Dispatcher() { | |
override fun dispatch(request: RecordedRequest): MockResponse { | |
return when (request.path) { | |
"/movie/top_rated?api_key=${API_KEY}&language=en-US&page=1" -> | |
MockResponse().setResponseCode(200) | |
.setBody(FileReader.readStringFromFile("success_response.json")) | |
.throttleBody(1024, 200L, TimeUnit.MILLISECONDS) | |
else -> MockResponse().setResponseCode(400) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM example-registry.company-domain.com/image/openjdk:11 | |
ENV ANDROID_COMPILE_SDK=33 | |
ENV ANDROID_BUILD_TOOLS=33.0.0 | |
ENV ANDROID_SDK_TOOLS=6514223 | |
ENV EMULATOR_VERSION=24 | |
SHELL ["/bin/bash", "-c"] | |
RUN apt-get --quiet update --yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
RUN apt-get update -y && \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils vagrant && \ | |
apt-get autoclean && \ | |
apt-get autoremove && \ | |
vagrant plugin install vagrant-libvirt | |
COPY start.sh / | |
ENTRYPOINT [ "/start.sh" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -eou pipefail | |
chown root:kvm /dev/kvm | |
service libvirtd start | |
service virtlogd start | |
exec "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update -y | |
install -d $ANDROID_HOME | |
wget --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip --no-check-certificate | |
pushd $ANDROID_HOME | |
unzip -d cmdline-tools cmdline-tools.zip | |
popd | |
sdkmanager --version | |
yes | sdkmanager --sdk_root=${ANDROID_HOME} --licenses || true | |
sdkmanager --sdk_root=${ANDROID_HOME} "platforms;android-${ANDROID_COMPILE_SDK}" | |
sdkmanager --sdk_root=${ANDROID_HOME} "platform-tools" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ANDROID_COMPILE_SDK=33 | |
export ANDROID_BUILD_TOOLS=33.0.0 | |
export ANDROID_SDK_TOOLS=6514223 | |
export EMULATOR_VERSION=31 | |
export ANDROID_HOME="${PWD}/android-home" | |
export ANDROID_SDK_ROOT=$ANDROID_HOME | |
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/tools/bin/:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update -y | |
apt-get --quiet install --yes libx11-dev libgl1 libpulse0 libnss3 libxcomposite-dev libxcursor1 libasound2 | |
apt-get update | |
apt-get install -y libgl1-mesa-glx | |
sdkmanager --update > update.log | |
sdkmanager "platform-tools" "emulator" "system-images;android-${EMULATOR_VERSION};default;x86_64" > installEmulator.log | |
wget --quiet --output-document=android-wait-for-emulator https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator | |
chmod +x android-wait-for-emulator | |
chmod +x gradlew |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb shell settings put global window_animation_scale 0 | |
adb shell settings put global transition_animation_scale 0 | |
adb shell settings put global animator_duration_scale 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo no | avdmanager create avd --force -n yourEmulatorName -k "system-images;android-${EMULATOR_VERSION};default;x86_64" | |
adb start-server | |
emulator -avd yourEmulatorName -no-window -no-audio -no-boot-anim -gpu off | |
./android-wait-for-emulator | |
adb shell input keyevent 82 |