|
1
|
|
package com.rbctcsworld.ecommerce.address; |
|
2
|
|
|
|
3
|
|
import com.rbctcsworld.ecommerce.address.AddressDtos.AddressRequest; |
|
4
|
|
import com.rbctcsworld.ecommerce.address.AddressDtos.AddressResponse; |
|
5
|
|
import com.rbctcsworld.ecommerce.auth.AppUser; |
|
6
|
|
import com.rbctcsworld.ecommerce.auth.UserRepository; |
|
7
|
|
import com.rbctcsworld.ecommerce.common.exception.ConflictException; |
|
8
|
|
import com.rbctcsworld.ecommerce.common.exception.NotFoundException; |
|
9
|
|
import com.rbctcsworld.ecommerce.order.ShippingAddress; |
|
10
|
|
import org.springframework.stereotype.Service; |
|
11
|
|
import org.springframework.transaction.annotation.Transactional; |
|
12
|
|
|
|
13
|
|
import java.util.List; |
|
14
|
|
import java.util.Locale; |
|
15
|
|
|
|
16
|
|
/** |
|
17
|
|
* The customer's address book. Rules: |
|
18
|
|
* - at most {@value #MAX} addresses (409 when full); |
|
19
|
|
* - the same address twice is refused (409; compared without case and extra spaces, label ignored); |
|
20
|
|
* - the first address is the default; makeDefault moves the default; deleting the default makes the newest |
|
21
|
|
* remaining address the default; |
|
22
|
|
* - somebody else's address does not exist for you (404), so ids cannot be probed. |
|
23
|
|
*/ |
|
24
|
|
@Service |
|
25
|
|
@Transactional |
|
26
|
|
public class AddressService { |
|
27
|
|
|
|
28
|
|
public static final int MAX = 10; |
|
29
|
|
|
|
30
|
|
private final CustomerAddressRepository repo; |
|
31
|
|
private final UserRepository users; |
|
32
|
|
|
|
33
|
|
public AddressService(CustomerAddressRepository repo, UserRepository users) { |
|
34
|
|
this.repo = repo; |
|
35
|
|
this.users = users; |
|
36
|
|
} |
|
37
|
|
|
|
38
|
|
@Transactional(readOnly = true) |
|
39
|
|
public List<AddressResponse> list(String email) { |
|
40
|
1
1. list : replaced return value with Collections.emptyList for com/rbctcsworld/ecommerce/address/AddressService::list → KILLED
|
return mine(user(email).getId()).stream().map(AddressResponse::from).toList(); |
|
41
|
|
} |
|
42
|
|
|
|
43
|
|
public AddressResponse add(String email, AddressRequest r) { |
|
44
|
|
Long userId = user(email).getId(); |
|
45
|
|
List<CustomerAddress> all = mine(userId); |
|
46
|
2
1. add : changed conditional boundary → KILLED
2. add : removed conditional - replaced comparison check with false → KILLED
|
if (all.size() >= MAX) throw new ConflictException("Your address book is full (" + MAX + " addresses). Delete one first."); |
|
47
|
|
ShippingAddress a = r.address().normalized(); |
|
48
|
1
1. add : removed call to com/rbctcsworld/ecommerce/address/AddressService::refuseTwin → KILLED
|
refuseTwin(all, a, null); |
|
49
|
|
CustomerAddress saved = new CustomerAddress(userId); |
|
50
|
1
1. add : removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::change → KILLED
|
saved.change(label(r.label()), a); |
|
51
|
|
boolean first = all.isEmpty(); |
|
52
|
3
1. add : removed conditional - replaced equality check with false → KILLED
2. add : removed call to com/rbctcsworld/ecommerce/address/AddressService::clearDefault → KILLED
3. add : removed conditional - replaced equality check with false → KILLED
|
if (first || r.makeDefault()) clearDefault(all); |
|
53
|
3
1. add : removed conditional - replaced equality check with false → KILLED
2. add : removed conditional - replaced equality check with false → KILLED
3. add : removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
|
saved.setDefault(first || r.makeDefault()); |
|
54
|
1
1. add : replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::add → KILLED
|
return AddressResponse.from(repo.save(saved)); |
|
55
|
|
} |
|
56
|
|
|
|
57
|
|
public AddressResponse update(String email, long id, AddressRequest r) { |
|
58
|
|
Long userId = user(email).getId(); |
|
59
|
|
CustomerAddress a = owned(id, userId); |
|
60
|
|
ShippingAddress normalized = r.address().normalized(); |
|
61
|
|
List<CustomerAddress> all = mine(userId); |
|
62
|
1
1. update : removed call to com/rbctcsworld/ecommerce/address/AddressService::refuseTwin → KILLED
|
refuseTwin(all, normalized, id); |
|
63
|
1
1. update : removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::change → KILLED
|
a.change(label(r.label()), normalized); |
|
64
|
2
1. update : removed conditional - replaced equality check with false → KILLED
2. update : removed conditional - replaced equality check with false → KILLED
|
if (r.makeDefault() && !a.isDefault()) { |
|
65
|
1
1. update : removed call to com/rbctcsworld/ecommerce/address/AddressService::clearDefault → KILLED
|
clearDefault(all); |
|
66
|
1
1. update : removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
|
a.setDefault(true); |
|
67
|
|
} |
|
68
|
1
1. update : replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::update → KILLED
|
return AddressResponse.from(repo.save(a)); |
|
69
|
|
} |
|
70
|
|
|
|
71
|
|
public AddressResponse makeDefault(String email, long id) { |
|
72
|
|
Long userId = user(email).getId(); |
|
73
|
|
CustomerAddress a = owned(id, userId); |
|
74
|
1
1. makeDefault : removed call to com/rbctcsworld/ecommerce/address/AddressService::clearDefault → KILLED
|
clearDefault(mine(userId)); |
|
75
|
1
1. makeDefault : removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
|
a.setDefault(true); |
|
76
|
1
1. makeDefault : replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::makeDefault → SURVIVED
|
return AddressResponse.from(repo.save(a)); |
|
77
|
|
} |
|
78
|
|
|
|
79
|
|
public void delete(String email, long id) { |
|
80
|
|
Long userId = user(email).getId(); |
|
81
|
|
CustomerAddress a = owned(id, userId); |
|
82
|
|
boolean wasDefault = a.isDefault(); |
|
83
|
1
1. delete : removed call to com/rbctcsworld/ecommerce/address/CustomerAddressRepository::delete → KILLED
|
repo.delete(a); |
|
84
|
1
1. delete : removed call to com/rbctcsworld/ecommerce/address/CustomerAddressRepository::flush → SURVIVED
|
repo.flush(); |
|
85
|
1
1. delete : removed conditional - replaced equality check with false → KILLED
|
if (wasDefault) { |
|
86
|
|
mine(userId).stream().max(java.util.Comparator.comparing(CustomerAddress::getCreatedAt) |
|
87
|
|
.thenComparing(CustomerAddress::getId)) |
|
88
|
2
1. lambda$delete$0 : removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
2. delete : removed call to java/util/Optional::ifPresent → KILLED
|
.ifPresent(next -> { next.setDefault(true); repo.save(next); }); |
|
89
|
|
} |
|
90
|
|
} |
|
91
|
|
|
|
92
|
|
private void refuseTwin(List<CustomerAddress> all, ShippingAddress a, Long self) { |
|
93
|
|
String key = key(a); |
|
94
|
|
for (CustomerAddress other : all) { |
|
95
|
2
1. refuseTwin : removed conditional - replaced equality check with false → KILLED
2. refuseTwin : removed conditional - replaced equality check with false → KILLED
|
if (!other.getId().equals(self) && key(other.address()).equals(key)) { |
|
96
|
|
throw new ConflictException("This address is already in your address book" |
|
97
|
1
1. refuseTwin : removed conditional - replaced equality check with false → SURVIVED
|
+ (other.getLabel() == null ? "" : " as \"" + other.getLabel() + "\"")); |
|
98
|
|
} |
|
99
|
|
} |
|
100
|
|
} |
|
101
|
|
|
|
102
|
|
/** Name, street, city, state and ZIP without case or extra spaces (phone and label do not make it another place). */ |
|
103
|
|
static String key(ShippingAddress a) { |
|
104
|
2
1. key : replaced return value with "" for com/rbctcsworld/ecommerce/address/AddressService::key → KILLED
2. key : removed conditional - replaced equality check with false → KILLED
|
return String.join("|", a.fullName(), a.line1(), a.line2() == null ? "" : a.line2(), a.city(), a.state(), a.zip()) |
|
105
|
|
.toLowerCase(Locale.ROOT).replaceAll("\\s+", " ").trim(); |
|
106
|
|
} |
|
107
|
|
|
|
108
|
|
private static String label(String label) { |
|
109
|
3
1. label : removed conditional - replaced equality check with false → KILLED
2. label : removed conditional - replaced equality check with false → KILLED
3. label : replaced return value with "" for com/rbctcsworld/ecommerce/address/AddressService::label → KILLED
|
return label == null || label.isBlank() ? null : label.trim().replaceAll("\\s+", " "); |
|
110
|
|
} |
|
111
|
|
|
|
112
|
|
private void clearDefault(List<CustomerAddress> all) { |
|
113
|
|
for (CustomerAddress a : all) { |
|
114
|
1
1. clearDefault : removed conditional - replaced equality check with false → KILLED
|
if (a.isDefault()) { |
|
115
|
1
1. clearDefault : removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
|
a.setDefault(false); |
|
116
|
|
repo.save(a); |
|
117
|
|
} |
|
118
|
|
} |
|
119
|
1
1. clearDefault : removed call to com/rbctcsworld/ecommerce/address/CustomerAddressRepository::flush → SURVIVED
|
repo.flush(); |
|
120
|
|
} |
|
121
|
|
|
|
122
|
|
private List<CustomerAddress> mine(Long userId) { |
|
123
|
1
1. mine : replaced return value with Collections.emptyList for com/rbctcsworld/ecommerce/address/AddressService::mine → KILLED
|
return repo.findByUserIdOrderByIsDefaultDescCreatedAtDescIdDesc(userId); |
|
124
|
|
} |
|
125
|
|
|
|
126
|
|
private CustomerAddress owned(long id, Long userId) { |
|
127
|
2
1. owned : replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::owned → KILLED
2. lambda$owned$1 : replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::lambda$owned$1 → KILLED
|
return repo.findByIdAndUserId(id, userId).orElseThrow(() -> new NotFoundException("Address not found: " + id)); |
|
128
|
|
} |
|
129
|
|
|
|
130
|
|
private AppUser user(String email) { |
|
131
|
2
1. lambda$user$2 : replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::lambda$user$2 → KILLED
2. user : replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::user → KILLED
|
return users.findByEmail(email).orElseThrow(() -> new NotFoundException("User not found")); |
|
132
|
|
} |
|
133
|
|
} |
| | Mutations |
| 40 |
|
1.1 Location : list Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theFirstAddressIsTheDefaultAndIsStoredTidy()] replaced return value with Collections.emptyList for com/rbctcsworld/ecommerce/address/AddressService::list → KILLED
|
| 46 |
|
1.1 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theBookHoldsTenAddresses()] changed conditional boundary → KILLED
2.2 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theBookHoldsTenAddresses()] removed conditional - replaced comparison check with false → KILLED
|
| 48 |
|
1.1 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()] removed call to com/rbctcsworld/ecommerce/address/AddressService::refuseTwin → KILLED
|
| 50 |
|
1.1 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()] removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::change → KILLED
|
| 52 |
|
1.1 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theFirstAddressIsTheDefaultAndIsStoredTidy()] removed conditional - replaced equality check with false → KILLED
2.2 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:makeDefaultMovesTheDefaultSoThereIsAlwaysExactlyOne()] removed call to com/rbctcsworld/ecommerce/address/AddressService::clearDefault → KILLED
3.3 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:makeDefaultMovesTheDefaultSoThereIsAlwaysExactlyOne()] removed conditional - replaced equality check with false → KILLED
|
| 53 |
|
1.1 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:makeDefaultMovesTheDefaultSoThereIsAlwaysExactlyOne()] removed conditional - replaced equality check with false → KILLED
2.2 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theFirstAddressIsTheDefaultAndIsStoredTidy()] removed conditional - replaced equality check with false → KILLED
3.3 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theFirstAddressIsTheDefaultAndIsStoredTidy()] removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
|
| 54 |
|
1.1 Location : add Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theFirstAddressIsTheDefaultAndIsStoredTidy()] replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::add → KILLED
|
| 62 |
|
1.1 Location : update Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] removed call to com/rbctcsworld/ecommerce/address/AddressService::refuseTwin → KILLED
|
| 63 |
|
1.1 Location : update Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::change → KILLED
|
| 64 |
|
1.1 Location : update Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] removed conditional - replaced equality check with false → KILLED
2.2 Location : update Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] removed conditional - replaced equality check with false → KILLED
|
| 65 |
|
1.1 Location : update Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] removed call to com/rbctcsworld/ecommerce/address/AddressService::clearDefault → KILLED
|
| 66 |
|
1.1 Location : update Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
|
| 68 |
|
1.1 Location : update Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::update → KILLED
|
| 74 |
|
1.1 Location : makeDefault Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:makeDefaultMovesTheDefaultSoThereIsAlwaysExactlyOne()] removed call to com/rbctcsworld/ecommerce/address/AddressService::clearDefault → KILLED
|
| 75 |
|
1.1 Location : makeDefault Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:makeDefaultMovesTheDefaultSoThereIsAlwaysExactlyOne()] removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
|
| 76 |
|
1.1 Location : makeDefault Killed by : none replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::makeDefault → SURVIVED
Covering tests
Covered by tests:
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:makeDefaultMovesTheDefaultSoThereIsAlwaysExactlyOne()]
|
| 83 |
|
1.1 Location : delete Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:deletingTheDefaultMakesTheNewestRemainingAddressTheDefault()] removed call to com/rbctcsworld/ecommerce/address/CustomerAddressRepository::delete → KILLED
|
| 84 |
|
1.1 Location : delete Killed by : none removed call to com/rbctcsworld/ecommerce/address/CustomerAddressRepository::flush → SURVIVED
Covering tests
Covered by tests:
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:deletingTheDefaultMakesTheNewestRemainingAddressTheDefault()]
|
| 85 |
|
1.1 Location : delete Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:deletingTheDefaultMakesTheNewestRemainingAddressTheDefault()] removed conditional - replaced equality check with false → KILLED
|
| 88 |
|
1.1 Location : lambda$delete$0 Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:deletingTheDefaultMakesTheNewestRemainingAddressTheDefault()] removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
2.2 Location : delete Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:deletingTheDefaultMakesTheNewestRemainingAddressTheDefault()] removed call to java/util/Optional::ifPresent → KILLED
|
| 95 |
|
1.1 Location : refuseTwin Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()] removed conditional - replaced equality check with false → KILLED
2.2 Location : refuseTwin Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()] removed conditional - replaced equality check with false → KILLED
|
| 97 |
|
1.1 Location : refuseTwin Killed by : none removed conditional - replaced equality check with false → SURVIVED
Covering tests
Covered by tests:
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()]
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()]
|
| 104 |
|
1.1 Location : key Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theKeyIgnoresCaseSpacesPhoneAndAnEmptySecondLine()] replaced return value with "" for com/rbctcsworld/ecommerce/address/AddressService::key → KILLED
2.2 Location : key Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theKeyIgnoresCaseSpacesPhoneAndAnEmptySecondLine()] removed conditional - replaced equality check with false → KILLED
|
| 109 |
|
1.1 Location : label Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()] removed conditional - replaced equality check with false → KILLED
2.2 Location : label Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theFirstAddressIsTheDefaultAndIsStoredTidy()] removed conditional - replaced equality check with false → KILLED
3.3 Location : label Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()] replaced return value with "" for com/rbctcsworld/ecommerce/address/AddressService::label → KILLED
|
| 114 |
|
1.1 Location : clearDefault Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] removed conditional - replaced equality check with false → KILLED
|
| 115 |
|
1.1 Location : clearDefault Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()] removed call to com/rbctcsworld/ecommerce/address/CustomerAddress::setDefault → KILLED
|
| 119 |
|
1.1 Location : clearDefault Killed by : none removed call to com/rbctcsworld/ecommerce/address/CustomerAddressRepository::flush → SURVIVED
Covering tests
Covered by tests:
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()]
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theFirstAddressIsTheDefaultAndIsStoredTidy()]
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theBookHoldsTenAddresses()]
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:deletingTheDefaultMakesTheNewestRemainingAddressTheDefault()]
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUpdateMayKeepItsOwnAddressButNotBecomeAnotherOne()]
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:makeDefaultMovesTheDefaultSoThereIsAlwaysExactlyOne()]
- com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:somebodyElsesAddressDoesNotExistForYou()]
|
| 123 |
|
1.1 Location : mine Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()] replaced return value with Collections.emptyList for com/rbctcsworld/ecommerce/address/AddressService::mine → KILLED
|
| 127 |
|
1.1 Location : owned Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:deletingTheDefaultMakesTheNewestRemainingAddressTheDefault()] replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::owned → KILLED
2.2 Location : lambda$owned$1 Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:somebodyElsesAddressDoesNotExistForYou()] replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::lambda$owned$1 → KILLED
|
| 131 |
|
1.1 Location : lambda$user$2 Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:anUnknownUserIsNotFound()] replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::lambda$user$2 → KILLED
2.2 Location : user Killed by : com.rbctcsworld.ecommerce.address.AddressServiceTest.[engine:junit-jupiter]/[class:com.rbctcsworld.ecommerce.address.AddressServiceTest]/[method:theSameAddressTwiceIsRefusedWhateverTheCaseSpacesPhoneOrLabel()] replaced return value with null for com/rbctcsworld/ecommerce/address/AddressService::user → KILLED
|