Optional<String> placementGroupEc2() {
        return getOptionalMetadata(ec2MetadataEndpoint.concat("/placement/group-name/"), "placement group");
    }
@Test
    public void failToFetchPlacementGroupEc2() {
        // given
        stubFor(get(urlEqualTo(GROUP_NAME_URL))
                .willReturn(aResponse().withStatus(HttpURLConnection.HTTP_INTERNAL_ERROR).withBody("Service Unavailable")));

        // when
        Optional<String> placementGroupResult = awsMetadataApi.placementGroupEc2();

        // then
        assertEquals(Optional.empty(), placementGroupResult);
        verify(moreThan(RETRY_COUNT), getRequestedFor(urlEqualTo(GROUP_NAME_URL)));
    }