public String ensureRootFolder() throws IOException, InvalidTokenException {
    if (!rootEnsured) {
      ensureFolder("/", ROOT_NAME);
      rootEnsured = true;
    }

    return getRootPath();
  }
@Test
  public void testEnsureRootFolder() throws Exception {
    server.enqueue(new MockResponse().setResponseCode(200));

    client.ensureRootFolder();

    assertEquals(1, server.getRequestCount());

    final RecordedRequest recordedRequest = server.takeRequest();

    assertEquals("POST", recordedRequest.getMethod());
    assertEquals("/api/v2/mounts/primary/files/folder?path=%2F", recordedRequest.getPath());
    assertEquals("Bearer acc", recordedRequest.getHeader("Authorization"));
    assertEquals("2.1", recordedRequest.getHeader("X-Koofr-Version"));
    assertEquals(
        "application/json; charset=utf-8", recordedRequest.getHeader("Content-Type"));
    assertEquals("{\"name\":\"Data transfer\"}", recordedRequest.getBody().readUtf8());

    client.ensureRootFolder();

    assertEquals(1, server.getRequestCount());
  }