@Test
public void normalGetComponentIdsByType() throws Exception {

    final long serviceId = 7117;
    final String [] cidarray = new String[]{".component-1"};
    final Collection cMetadatas = new ArrayList();
    cMetadatas.add(mockServiceMetadata);
    
    mockery.checking(new Expectations(){
        {
            oneOf(mockContext).getServiceReferences(with(any(String.class)), with(any(String.class)));
            will(returnValue(mockServiceReferences));
            oneOf(mockContext).getService(mockServiceReferences[0]);
            will(returnValue(mockContainer));
        }
    });
    mockery.checking(new Expectations(){
        {
            oneOf(mockContainer).getMetadata(ServiceMetadata.class);
            will(returnValue(cMetadatas));
        }
    });
    mockery.checking(new Expectations(){
        {
            oneOf(mockServiceMetadata).getId();
            will(returnValue(cidarray[0]));
        }
    });
    
    assertArrayEquals(cidarray, 
            metadata.getComponentIdsByType(serviceId, BlueprintMetadataMBean.SERVICE_METADATA));
}