@Test(dataProvider = "spiffeUriData")
public void testValidateSpiffeUri(final String csrPath, boolean expectedResult) throws IOException {

    Path path = Paths.get(csrPath);
    String csr = new String(Files.readAllBytes(path));
    X509ServiceCertRequest certReq = new X509ServiceCertRequest(csr);
    assertNotNull(certReq);
    StringBuilder errorMsg = new StringBuilder(256);
    List<String> providerDnsSuffixList = Collections.singletonList("ostk.athenz.cloud");
    DataCache athenzSysDomainCache = Mockito.mock(DataCache.class);
    Mockito.when(athenzSysDomainCache.getProviderDnsSuffixList("provider")).thenReturn(providerDnsSuffixList);
    HashSet<String> validOrgs = new HashSet<>();
    validOrgs.add("Athenz");
    boolean ourResult = certReq.validate("athenz", "production", "provider",
            validOrgs, athenzSysDomainCache, null, null, null, null, errorMsg);
    assertEquals(ourResult, expectedResult);
}