I just got the Mockito framework for Java to try out mocking with JUnit. Trying it brought me to a basic question that I am sure is obvious but I have had trouble finding any answer for, probably because I don't have a concise way of asking it.
Say I have a class A that contains and uses instances of Class B. Now I can mock B and pass the mocked object to class A instance all is well and good, coupling is removed from my unit test. However, now if Class B changes in a way that breaks Class A, how will I know that occurred, since my mocked class B will still perform the same way? It kind of seems like you would want the Class A tests to fail to indicate that the change in B requires a change in A as well.
Is it just that you shouldn't mock in composition scenarios?