add junit tests for calculate total resources in cargo