Iterator headers = soapHeader.getHeadersToProcess(rp);
assertTrue("No headers!", headers.hasNext());
int numHeaders = 0;
while (headers.hasNext()) {
SOAPHeaderBlock header = (SOAPHeaderBlock)headers.next();
numHeaders++;
}
assertEquals("Didn't get right number of headers (with custom role)", 5, numHeaders);
rp = new MyRolePlayer(true);
headers = soapHeader.getHeadersToProcess(rp);
assertTrue(headers.hasNext());
numHeaders = 0;
while (headers.hasNext()) {
SOAPHeaderBlock header = (SOAPHeaderBlock)headers.next();
numHeaders++;
}
assertEquals("Didn't get right number of headers (no custom role)", 4, numHeaders);
// Intermediary test
rp = new MyRolePlayer(false);
headers = soapHeader.getHeadersToProcess(rp);
assertTrue(headers.hasNext());
numHeaders = 0;
while (headers.hasNext()) {
SOAPHeaderBlock header = (SOAPHeaderBlock)headers.next();
numHeaders++;
}
assertEquals("Didn't get right number of headers (no custom role)", 1, numHeaders);