@Test
public void testCheckServiceQuota() {

    
    QuotaChecker quotaCheck = new QuotaChecker();
    Quota mockQuota = new Quota().setName("athenz")
            .setService(2).setServiceHost(2).setPublicKey(2);
    ObjectStoreConnection con = Mockito.mock(ObjectStoreConnection.class);
    Mockito.when(con.getQuota("athenz")).thenReturn(mockQuota);
    Mockito.when(con.countServiceIdentities("athenz")).thenReturn(1);
    
    ArrayList<String> hosts = new ArrayList<>();
    hosts.add("host1");
    
    ArrayList<PublicKeyEntry> publicKeys = new ArrayList<>();
    publicKeys.add(new PublicKeyEntry().setId("id1").setKey("key"));
    
    ServiceIdentity service = new ServiceIdentity();
    service.setHosts(hosts);
    service.setPublicKeys(publicKeys);
    
    // this should be successful - no exceptions
    quotaCheck.checkServiceIdentityQuota(con, "athenz", service, "caller");
}