How to use String.encodeBase64ToString method of com.github.kittinunf.fuel.util.Base64 class

Best Fuel code snippet using com.github.kittinunf.fuel.util.Base64.String.encodeBase64ToString

HappyPathTest.kt

Source:HappyPathTest.kt Github

copy

Full Screen

1package io.github.jokoroukwu.zephyrapi.integration2import com.github.kittinunf.fuel.core.Headers3import com.github.kittinunf.fuel.util.encodeBase64ToString4import com.github.tomakehurst.wiremock.WireMockServer5import com.github.tomakehurst.wiremock.client.BasicCredentials6import com.github.tomakehurst.wiremock.client.WireMock.*7import com.github.tomakehurst.wiremock.core.WireMockConfiguration8import com.github.tomakehurst.wiremock.http.RequestMethod9import com.github.tomakehurst.wiremock.stubbing.ServeEvent10import io.github.jokoroukwu.zephyrapi.ZephyrClient11import io.github.jokoroukwu.zephyrapi.config.ZephyrConfig12import io.github.jokoroukwu.zephyrapi.config.ZephyrConfigImpl13import io.github.jokoroukwu.zephyrapi.http.AbstractRequestSender.Companion.BASE_API_URL14import io.github.jokoroukwu.zephyrapi.http.JsonMapper15import io.github.jokoroukwu.zephyrapi.integration.util.Stubber16import io.github.jokoroukwu.zephyrapi.publication.TestDataResultBase17import io.github.jokoroukwu.zephyrapi.publication.TestResultBase18import io.github.jokoroukwu.zephyrapi.publication.TestRunBase19import io.github.jokoroukwu.zephyrapi.publication.detailedreportprocessor.*20import io.github.jokoroukwu.zephyrapi.publication.keytoitemmapcomplementor.*21import io.github.jokoroukwu.zephyrapi.publication.publicationfinalizer.SerializableTestResult22import io.github.jokoroukwu.zephyrapi.publication.testcyclecreator.CreateTestCycleRequest23import io.github.jokoroukwu.zephyrapi.publication.testcyclecreator.CreateTestCycleRequestSender.Companion.DEFAULT_FORMATTER24import io.github.jokoroukwu.zephyrapi.publication.testcycleupdater.UpdateTestCycleRequest25import io.github.jokoroukwu.zephyrapi.publication.testresultstatuscomplementor.TestResultStatus26import io.mockk.unmockkAll27import kotlinx.serialization.decodeFromString28import kotlinx.serialization.json.Json29import org.assertj.core.api.Assertions30import org.assertj.core.api.SoftAssertions31import org.testng.annotations.AfterClass32import org.testng.annotations.BeforeClass33import org.testng.annotations.Test34import java.net.URL35import java.time.Instant36import java.time.ZoneOffset37import java.util.*38import java.util.stream.Collectors39const val DEFAULT_CYCLE_KEY = "test-cycle-key"40const val DEFAULT_PROJECT_ID = 1L41const val DEFAULT_CYCLE_ID = 1L42const val DATA_DRIVEN_TEST_CASE_KEY = "data-driven-test-case-key"43const val NON_DATA_DRIVEN_TEST_CASE = "non-data-driven-test-case-key"44class HappyPathTest {45 private val wireMockPort = 235546 private val wireMockHttpsPort = 235447 private val idOne = 1L48 private val idTwo = 2L49 private val zephyrConfig: ZephyrConfig = ZephyrConfigImpl(50 ZoneOffset.UTC,51 URL("https://localhost:$wireMockHttpsPort"),52 "PROJ-123",53 "user",54 "pass"55 )56 private val wireMock = WireMockServer(WireMockConfiguration().httpsPort(wireMockHttpsPort).port(wireMockPort))57 .also { configureFor("localhost", wireMockPort) }58 private val testCaseItems = listOf(59 TestCaseItem(60 id = 1,61 key = NON_DATA_DRIVEN_TEST_CASE,62 projectId = DEFAULT_PROJECT_ID,63 testData = listOf(),64 testScript = TestScriptItem(listOf(StepItem(0), StepItem(1)))65 ),66 TestCaseItem(67 id = 2,68 key = DATA_DRIVEN_TEST_CASE_KEY,69 projectId = DEFAULT_PROJECT_ID,70 testData = listOf(TestDataItem(1), TestDataItem(2)),71 testScript = TestScriptItem(listOf(StepItem(0), StepItem(1)))72 )73 )74 private val testRun = TestRunBase(75 name = "test-run-1",76 testResults = listOf(77 TestResultBase(78 NON_DATA_DRIVEN_TEST_CASE,79 listOf(TestDataResultBase(0, false, 1, "step 1 failed")),80 1,81 282 ),83 TestResultBase(84 DATA_DRIVEN_TEST_CASE_KEY,85 listOf(86 TestDataResultBase(0, false, 0, "step 0 failed"),87 TestDataResultBase(1, true, null)88 ),89 3,90 491 )92 ),93 1,94 495 )96 private val reportTestResults = listOf(97 ReportTestResult(98 id = idOne,99 testCase = TestCase(idOne, NON_DATA_DRIVEN_TEST_CASE, "non-data-driven-test-case-name"),100 testScriptResults = listOf(ReportStepResult(idOne, 0), ReportStepResult(idTwo, 1))101 ),102 ReportTestResult(103 id = idTwo,104 testCase = TestCase(idTwo, DATA_DRIVEN_TEST_CASE_KEY, "data-driven-test-case-name"),105 testScriptResults = listOf(106 ReportStepResult(3, 0), ReportStepResult(4, 1),107 ReportStepResult(5, 0), ReportStepResult(6, 1)108 )109 )110 )111 private lateinit var createTestCycleStub: UUID112 private lateinit var updateTestCycleStub: UUID113 private lateinit var updateTestResultsStub: UUID114 private lateinit var updateTestScriptResultsStub: UUID115 private lateinit var getDetailedReportStub: UUID116 @BeforeClass117 fun setUp() {118 val zephyrConfig = ZephyrConfigImpl(119 timeZone = zephyrConfig.timeZone,120 jiraUrl = URL("https://localhost:$wireMockHttpsPort"),121 projectKey = zephyrConfig.projectKey,122 username = zephyrConfig.username,123 password = zephyrConfig.password124 )125 with(wireMock) {126 start()127 Stubber(zephyrConfig).run {128 stubGetTestCasesRequest(testCaseItems)129 stubGetTestResultStatusesRequest()130 createTestCycleStub = stubCreateTestCycleRequest()131 updateTestCycleStub = stubUpdateTestCycleRequest()132 getDetailedReportStub = stubGetDetailedReportRequest(TestRunDetailReport(reportTestResults))133 updateTestResultsStub = stubUpdateTestResultsRequest()134 updateTestScriptResultsStub = stubUpdateTestScriptResultsRequest()135 }136 }137 ZephyrClient.publishTestResults(listOf(testRun), zephyrConfig)138 }139 @Test140 fun `should submit single valid getTestCases request`() {141 val inClause = listOf(DATA_DRIVEN_TEST_CASE_KEY, NON_DATA_DRIVEN_TEST_CASE).joinToString(142 prefix = "('", separator = "','", postfix = "')"143 )144 val url = "$BASE_API_URL/testcase/search?fields=id,key,projectId,testData(id)," +145 "testScript(steps(index))&maxResults=$MAX_TEST_CASE_COUNT&query=testCase.key%20IN$inClause"146 verify(147 exactly(1), getRequestedFor(urlEqualTo(url))148 .withBasicAuth(BasicCredentials(zephyrConfig.username, zephyrConfig.password))149 )150 }151 @Test152 fun `should submit single valid getTestResultStatuses request`() {153 val url = "$BASE_API_URL/project/$DEFAULT_PROJECT_ID/testresultstatus"154 verify(155 exactly(1), getRequestedFor(urlEqualTo(url))156 .withBasicAuth(BasicCredentials(zephyrConfig.username, zephyrConfig.password))157 )158 }159 @Test160 fun `should submit single valid createTestCycleRequest`() {161 val request = wireMock.assertHasSingleRequest(162 createTestCycleStub, "should have received single CreateTestCycle request"163 )164 softly {165 assertThat(request.header(Headers.AUTHORIZATION).firstValue())166 .`as`("should have expected auth header")167 .isEqualTo(zephyrConfig.basicAuthBase64())168 val actualCreateTestCycleRequest: CreateTestCycleRequest = Json.decodeFromString(request.bodyAsString);169 val expectedStartDate = Instant.ofEpochMilli(testRun.startTime)170 val expectedEndDate = Instant.ofEpochMilli(testRun.endTime)171 val expectedTestCycleName = String.format(172 "%s (%s - %s)",173 testRun.name,174 expectedStartDate.atZone(zephyrConfig.timeZone).format(DEFAULT_FORMATTER),175 expectedEndDate.atZone(zephyrConfig.timeZone).format(DEFAULT_FORMATTER)176 )177 val expectedCreateTestCycleRequest =178 CreateTestCycleRequest(179 DEFAULT_PROJECT_ID,180 expectedTestCycleName,181 expectedStartDate.toString(),182 expectedEndDate.toString()183 )184 assertThat(actualCreateTestCycleRequest)185 .`as`("should have received expected request")186 .isEqualTo(expectedCreateTestCycleRequest)187 assertAll()188 }189 }190 @Test191 fun `should submit single valid 'update test cycle request'`() {192 val request = wireMock.assertHasSingleRequest(193 updateTestCycleStub, "UpdateTestCycle request count validation"194 )195 softly {196 val description = "Update test cycle request: %s"197 assertThat(request.header(Headers.AUTHORIZATION).firstValue())198 .`as`(description, "basic authorization header")199 .isEqualTo(zephyrConfig.basicAuthBase64())200 assertThat(request.method)201 .`as`(description, "method")202 .isEqualTo(RequestMethod.PUT)203 assertThat(request)204 .`as`(description, "body")205 .satisfies { rq ->206 val updateTestCycleRequest = Json.decodeFromString<UpdateTestCycleRequest>(rq.bodyAsString)207 assertThat(updateTestCycleRequest.testRunId)208 .`as`(description, "test run id")209 .isEqualTo(DEFAULT_CYCLE_ID)210 assertThat(updateTestCycleRequest.addedTestRunItems.map { it.lastTestResult.testCaseId })211 .`as`(description, "test case ids")212 .containsExactlyInAnyOrder(1, 2)213 assertThat(updateTestCycleRequest.addedTestRunItems.map { it.index })214 .`as`(description, "added test run items' indexes")215 .containsExactlyInAnyOrder(0, 1)216 assertThat(updateTestCycleRequest.addedTestRunItems.map { it.id })217 .`as`(description, "added test run items' ids")218 .containsOnlyNulls()219 }220 assertAll()221 }222 }223 @Test224 fun `should submit single valid getDetailedReportRequest`() {225 val request = wireMock.assertHasSingleRequest(226 getDetailedReportStub, "get detailed report requests count validation"227 )228 softly {229 val description = "GetDetailedReport request: %s"230 assertThat(request.header(Headers.AUTHORIZATION).firstValue())231 .`as`(description, "basic authorization header")232 .isEqualTo(zephyrConfig.basicAuthBase64())233 assertThat(request.method)234 .`as`(description, "method")235 .isEqualTo(RequestMethod.GET)236 assertAll()237 }238 }239 @Test240 fun `should submit single valid updateTestResultsRequest`() {241 val request = wireMock.assertHasSingleRequest(242 updateTestResultsStub, "UpdateTestResult requests count validation"243 )244 softly {245 val description = "UpdateTestResultsRequest request: %s"246 assertThat(request.header(Headers.AUTHORIZATION).firstValue())247 .`as`(description, "basic authorization header")248 .isEqualTo(zephyrConfig.basicAuthBase64())249 assertThat(request.method)250 .`as`(description, "method")251 .isEqualTo(RequestMethod.PUT)252 val actualTestResults =253 JsonMapper.instance.decodeFromString<List<SerializableTestResult>>(request.bodyAsString)254 val testResultOne = testRun.testResults[0]255 val testResultTwo = testRun.testResults[1]256 val expectedTestResults = listOf(257 SerializableTestResult(258 id = reportTestResults[0].id,259 testResultStatusId = TestResultStatus.FAIL.ordinal.toLong(),260 executionTime = testResultOne.endTime - testResultOne.startTime261 ),262 SerializableTestResult(263 id = reportTestResults[1].id,264 testResultStatusId = TestResultStatus.FAIL.ordinal.toLong(),265 executionTime = testResultTwo.endTime - testResultTwo.startTime266 )267 )268 assertThat(actualTestResults)269 .`as`("should contain expected test results")270 .containsExactlyInAnyOrderElementsOf(expectedTestResults)271 assertAll()272 }273 }274 @Test275 fun `should submit single valid updateTestScriptResultsRequest`() {276 val request = wireMock.assertHasSingleRequest(277 updateTestScriptResultsStub, "UpdateTestScriptResultsRequest count validation"278 )279 softly {280 val description = "UpdateTestScriptResultsRequest request: %s"281 assertThat(request.header(Headers.AUTHORIZATION).firstValue())282 .`as`(description, "basic authorization header")283 .isEqualTo(zephyrConfig.basicAuthBase64())284 assertThat(request.method)285 .`as`(description, "method")286 .isEqualTo(RequestMethod.PUT)287 val actualTestScriptResults =288 JsonMapper.instance.decodeFromString<List<TestScriptResult>>(request.bodyAsString)289 val expectedScriptResults = listOf(290 TestScriptResult(1, TestResultStatus.PASS.ordinal.toLong()),291 TestScriptResult(2, TestResultStatus.FAIL.ordinal.toLong(), "step 1 failed"),292 TestScriptResult(3, TestResultStatus.FAIL.ordinal.toLong(), "step 0 failed"),293 TestScriptResult(4, TestResultStatus.BLOCKED.ordinal.toLong()),294 TestScriptResult(5, TestResultStatus.PASS.ordinal.toLong()),295 TestScriptResult(6, TestResultStatus.PASS.ordinal.toLong()),296 )297 assertThat(actualTestScriptResults)298 .`as`("should contain expected test script results ")299 .containsExactlyInAnyOrderElementsOf(expectedScriptResults)300 assertAll()301 }302 }303 @AfterClass(alwaysRun = true)304 fun tearDown() {305 unmockkAll()306 wireMock.stop()307 }308 private fun WireMockServer.assertHasSingleRequest(id: UUID, description: String) = allServeEvents.stream()309 .filter { event -> event.stubMapping.id == id }310 .map(ServeEvent::getRequest)311 .collect(Collectors.toList())312 .also { Assertions.assertThat(it).`as`(description).hasSize(1) }[0]313 private inline fun <T> softly(assertion: SoftAssertions.() -> T) = assertion(SoftAssertions())314 private fun ZephyrConfig.basicAuthBase64() = "Basic ${"${username}:${password}".encodeBase64ToString()}"315}...

Full Screen

Full Screen

Base64.kt

Source:Base64.kt Github

copy

Full Screen

1package com.github.kittinunf.fuel.util2/**3 * Inspired From https://github.com/square/okio/blob/master/okio/src/main/kotlin/okio/-Base64.kt4 */5import java.lang.System.arraycopy6fun ByteArray.encodeBase64(): ByteArray = encodeBase64ToArray()7fun ByteArray.encodeBase64Url(): ByteArray = encodeBase64ToArray(map = BASE64_URL_SAFE)8fun String.encodeBase64ToString(): String = String(toByteArray().encodeBase64())9fun String.encodeBase64UrlToString(): String = String(toByteArray().encodeBase64Url())10fun String.decodeBase64(): ByteArray? = decodeBase64ToArray()?.let { it }11fun String.decodeBase64ToString(): String? = decodeBase64ToArray()?.let { String(it) }12private val regular = listOf(('A'..'Z'), ('a'..'z'), ('0'..'9'), listOf('+', '/'))13private val urlSafe = listOf(('A'..'Z'), ('a'..'z'), ('0'..'9'), listOf('-', '_'))14private val BASE64 = regular.flatten().map { it.toByte() }.toByteArray()15private val BASE64_URL_SAFE = urlSafe.flatten().map { it.toByte() }.toByteArray()16private fun ByteArray.encodeBase64ToArray(map: ByteArray = BASE64): ByteArray {17 val length = (size + 2) / 3 * 418 val out = ByteArray(length)19 var index = 020 val end = size - size % 321 var i = 022 while (i < end) {23 val b0 = this[i++].toInt()24 val b1 = this[i++].toInt()25 val b2 = this[i++].toInt()26 out[index++] = map[(b0 and 0xff shr 2)]27 out[index++] = map[(b0 and 0x03 shl 4) or (b1 and 0xff shr 4)]28 out[index++] = map[(b1 and 0x0f shl 2) or (b2 and 0xff shr 6)]29 out[index++] = map[(b2 and 0x3f)]30 }31 when (size - end) {32 1 -> {33 val b0 = this[i].toInt()34 out[index++] = map[b0 and 0xff shr 2]35 out[index++] = map[b0 and 0x03 shl 4]36 out[index++] = '='.toByte()37 out[index] = '='.toByte()38 }39 2 -> {40 val b0 = this[i++].toInt()41 val b1 = this[i].toInt()42 out[index++] = map[(b0 and 0xff shr 2)]43 out[index++] = map[(b0 and 0x03 shl 4) or (b1 and 0xff shr 4)]44 out[index++] = map[(b1 and 0x0f shl 2)]45 out[index] = '='.toByte()46 }47 }48 return out49}50private fun String.decodeBase64ToArray(): ByteArray? {51 // Ignore trailing '=' padding and whitespace from the input.52 var limit = length53 while (limit > 0) {54 val c = this[limit - 1]55 if (c != '=' && c != '\n' && c != '\r' && c != ' ' && c != '\t') {56 break57 }58 limit--59 }60 // If the input includes whitespace, this output array will be longer than necessary.61 val out = ByteArray((limit * 6L / 8L).toInt())62 var outCount = 063 var inCount = 064 var word = 065 for (pos in 0 until limit) {66 val c = this[pos]67 val bits: Int68 if (c in 'A'..'Z') {69 // char ASCII value70 // A 65 071 // Z 90 25 (ASCII - 65)72 bits = c.toInt() - 6573 } else if (c in 'a'..'z') {74 // char ASCII value75 // a 97 2676 // z 122 51 (ASCII - 71)77 bits = c.toInt() - 7178 } else if (c in '0'..'9') {79 // char ASCII value80 // 0 48 5281 // 9 57 61 (ASCII + 4)82 bits = c.toInt() + 483 } else if (c == '+' || c == '-') {84 bits = 6285 } else if (c == '/' || c == '_') {86 bits = 6387 } else if (c == '\n' || c == '\r' || c == ' ' || c == '\t') {88 continue89 } else {90 return null91 }92 // Append this char's 6 bits to the word.93 word = word shl 6 or bits94 // For every 4 chars of input, we accumulate 24 bits of output. Emit 3 bytes.95 inCount++96 if (inCount % 4 == 0) {97 out[outCount++] = (word shr 16).toByte()98 out[outCount++] = (word shr 8).toByte()99 out[outCount++] = word.toByte()100 }101 }102 val lastWordChars = inCount % 4103 when (lastWordChars) {104 1 -> {105 // We read 1 char followed by "===". But 6 bits is a truncated byte! Fail.106 return null107 }108 2 -> {109 // We read 2 chars followed by "==". Emit 1 byte with 8 of those 12 bits.110 word = word shl 12111 out[outCount++] = (word shr 16).toByte()112 }113 3 -> {114 // We read 3 chars, followed by "=". Emit 2 bytes for 16 of those 18 bits.115 word = word shl 6116 out[outCount++] = (word shr 16).toByte()117 out[outCount++] = (word shr 8).toByte()118 }119 }120 // If we sized our out array perfectly, we're done.121 if (outCount == out.size) return out122 // Copy the decoded bytes to a new, right-sized array.123 val prefix = ByteArray(outCount)124 arraycopy(out, 0, prefix, 0, outCount)125 return prefix126}...

Full Screen

Full Screen

Base64Test.kt

Source:Base64Test.kt Github

copy

Full Screen

1/**2 * Copied From https://github.com/square/okio/blob/master/okio/src/test/kotlin/okio/ByteStringTest.kt3 */4package com.github.kittinunf.fuel.util5import org.junit.Assert.assertArrayEquals6import org.junit.Assert.assertEquals7import org.junit.Test8class Base64Test {9 @Test10 fun encodeBase64() {11 assertEquals("", "".encodeBase64ToString())12 assertEquals("AA==", "\u0000".encodeBase64ToString())13 assertEquals("AAA=", "\u0000\u0000".encodeBase64ToString())14 assertEquals("AAAA", "\u0000\u0000\u0000".encodeBase64ToString())15 assertEquals("SG93IG1hbnkgbGluZXMgb2YgY29kZSBhcmUgdGhlcmU/ICdib3V0IDIgbWlsbGlvbi4=",16 "How many lines of code are there? 'bout 2 million.".encodeBase64ToString())17 }18 @Test19 fun encodeBase64Url() {20 assertEquals("", "".encodeBase64UrlToString())21 assertEquals("AA==", "\u0000".encodeBase64UrlToString())22 assertEquals("AAA=", "\u0000\u0000".encodeBase64UrlToString())23 assertEquals("AAAA", "\u0000\u0000\u0000".encodeBase64UrlToString())24 assertEquals("SG93IG1hbnkgbGluZXMgb2YgY29kZSBhcmUgdGhlcmU_ICdib3V0IDIgbWlsbGlvbi4=",25 "How many lines of code are there? 'bout 2 million.".encodeBase64UrlToString())26 }27 @Test28 fun ignoreUnnecessaryPadding() {29 assertEquals(null, "\\fgfgff\\".decodeBase64ToString())30 assertEquals("", "====".decodeBase64ToString())31 assertEquals("\u0000\u0000\u0000", "AAAA====".decodeBase64ToString())32 }33 @Test34 fun decodeBase64() {35 assertArrayEquals("".toByteArray(), "".decodeBase64())36 assertEquals("", "".decodeBase64ToString())37 assertEquals(null, "/===".decodeBase64ToString()) // Can't do anything with 6 bits!38 assertEquals("What's to be scared about? It's just a little hiccup in the power...",39 ("V2hhdCdzIHRvIGJlIHNjYXJlZCBhYm91dD8gSXQncyBqdXN0IGEgbGl0dGxlIGhpY2" +40 "N1cCBpbiB0aGUgcG93ZXIuLi4=").decodeBase64ToString())41 assertEquals("How many lines of code are there>", "SG93IG1hbnkgbGluZXMgb2YgY29kZSBhcmUgdGhlcmU+".decodeBase64ToString())42 }43 @Test44 fun decodeBase64WithWhitespace() {45 assertEquals("\u0000\u0000\u0000", " AA AA ".decodeBase64ToString())46 assertEquals("\u0000\u0000\u0000", " AA A\r\nA ".decodeBase64ToString())47 assertEquals("\u0000\u0000\u0000", "AA AA".decodeBase64ToString())48 assertEquals("\u0000\u0000\u0000", " AA AA ".decodeBase64ToString())49 assertEquals("\u0000\u0000\u0000", " AA A\r\nA ".decodeBase64ToString())50 assertEquals("\u0000\u0000\u0000", "A AAA".decodeBase64ToString())51 assertEquals("", " ".decodeBase64ToString())52 }53}...

Full Screen

Full Screen

String.encodeBase64ToString

Using AI Code Generation

copy

Full Screen

1val encodedString = Base64.encodeBase64ToString("Hello, World!".toByteArray())2val decodedString = Base64.decodeBase64ToString("SGVsbG8sIFdvcmxkIQ==")3val decodedByteArray = Base64.decodeBase64("SGVsbG8sIFdvcmxkIQ==")4val encodedString = byteArrayOf(1, 2, 3, 4, 5).encodeBase64()5val decodedByteArray = "AQIDBAU=".decodeBase64()6public static String encodeBase64ToString(byte[] bytes)7public static String decodeBase64ToString(String str)

Full Screen

Full Screen

String.encodeBase64ToString

Using AI Code Generation

copy

Full Screen

1import com.github.kittinunf.fuel.util.Base642val encoded = Base64.encodeBase64ToString("Hello World")3import com.github.kittinunf.fuel.util.Base644val decoded = Base64.decodeBase64ToString("SGVsbG8gV29ybGQ=")5import com.github.kittinunf.fuel.util.Base646val encoded = Base64.encodeBase64("Hello World")7import com.github.kittinunf.fuel.util.Base648val decoded = Base64.decodeBase64("SGVsbG8gV29ybGQ=")9import com.github.kittinunf.fuel.util.Base6410val encoded = Base64.encodeBase64ToByteArray("Hello World")11import com.github.kittinunf.fuel.util.Base6412val decoded = Base64.decodeBase64ToByteArray("SGVsbG8gV29ybGQ=")13import com.github.kittinunf.fuel.util.Base6414val encoded = Base64.encodeBase64ToByteArray("Hello World")15import com.github.kittinunf.fuel.util.Base6416val decoded = Base64.decodeBase64ToByteArray("SGVsbG8gV29ybGQ=")17import com.github.kittinunf.fuel.util.Base6418val encoded = Base64.encodeBase64ToByteArray("Hello World")

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful