Suppose I following classes:

```
class A {
 private B b;
 private int milkQuantity;

 A(B b) {
  this.b = b;
 }

 public getCoffee() {
  milkQuantity = b.getMilk(1);

  return secretRecipe();    
 }

 ...
}

```

So, while unit testing should I mock class `B` and check if `getMilk()` method was called or I should check if it returns the correct milk quantity(i.e 1 cup)? for the latter case I need to setup class `B` in my unit test.

According to me we need to check the behavior of class `B` in its own unit test, class `A` should be concerned only if the correct method was called or not.

**Update 1**

Making my point more clear:

on calling `a.getCoffee()` should I test:

```
assertThat(a.milkQuantity).isEqualTo(1);

```

**OR**

```
verify(b).getMilk();

```