String currentRegion() {
        int index = currentZone().lastIndexOf("-");
        return currentZone().substring(0, index);
    }
@Test
    public void currentRegion() {
        // given
        stubFor(get(urlEqualTo("/computeMetadata/v1/instance/zone"))
                .withHeader("Metadata-Flavor", equalTo("Google"))
                .willReturn(aResponse().withStatus(HttpURLConnection.HTTP_OK).withBody(zoneResponse(ZONE))));

        // when
        String result = gcpMetadataApi.currentRegion();

        // then
        assertEquals("us-east1", result);
    }