### Question:
KoofrClient { public String ensureVideosFolder() throws IOException, InvalidTokenException { String rootFolder = ensureRootFolder(); if (!videosEnsured) { ensureFolder(rootFolder, VIDEOS_NAME); videosEnsured = true; } return rootFolder + "/" + VIDEOS_NAME; } KoofrClient(
      String baseUrl,
      OkHttpClient client,
      OkHttpClient fileUploadClient,
      ObjectMapper objectMapper,
      Monitor monitor,
      KoofrCredentialFactory credentialFactory); boolean fileExists(String path); void ensureFolder(String parentPath, String name); void addDescription(String path, String description); @SuppressWarnings("unchecked") String uploadFile(
      String parentPath,
      String name,
      InputStream inputStream,
      String mediaType,
      Date modified,
      String description); String ensureRootFolder(); String ensureVideosFolder(); Credential getOrCreateCredential(TokensAndUrlAuthData authData); static String trimDescription(String description);  }### Answer:
@Test public void testEnsureVideosFolder() throws Exception { server.enqueue(new MockResponse().setResponseCode(200)); client.ensureRootFolder(); Assert.assertEquals(1, server.getRequestCount()); server.takeRequest(); server.enqueue(new MockResponse().setResponseCode(200)); client.ensureVideosFolder(); Assert.assertEquals(2, server.getRequestCount()); final RecordedRequest recordedRequest = server.takeRequest(); Assert.assertEquals("POST", recordedRequest.getMethod()); Assert.assertEquals( "/api/v2/mounts/primary/files/folder?path=%2FData+transfer", recordedRequest.getPath()); Assert.assertEquals("Bearer acc", recordedRequest.getHeader("Authorization")); Assert.assertEquals("2.1", recordedRequest.getHeader("X-Koofr-Version")); Assert.assertEquals( "application/json; charset=utf-8", recordedRequest.getHeader("Content-Type")); Assert.assertEquals("{\"name\":\"Videos\"}", recordedRequest.getBody().readUtf8()); client.ensureVideosFolder(); Assert.assertEquals(2, server.getRequestCount()); }