BAEL-5755: remove BAEL-5852 commits
This commit is contained in:
parent
cea912e42f
commit
ee97389e28
|
@ -1,9 +0,0 @@
|
|||
package com.baeldung.holder;
|
||||
|
||||
public class Holder<T> {
|
||||
public T value;
|
||||
|
||||
public Holder(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.baeldung.holder;
|
||||
|
||||
public class SupplierService {
|
||||
public void getSupplierByZipCode(String zip, Holder<Boolean> resultHolder) {
|
||||
if (zip.startsWith("9")) {
|
||||
resultHolder.value = true;
|
||||
} else {
|
||||
resultHolder.value = false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package com.baeldung.holder;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class SupplierServiceUnitTest {
|
||||
|
||||
@Test
|
||||
public void givenValidZipCode_whenGetSupplierByZipCode_thenTrue() {
|
||||
SupplierService service = new SupplierService();
|
||||
Holder<Boolean> resultHolder = new Holder<>(false);
|
||||
String zipCode = "98682";
|
||||
|
||||
service.getSupplierByZipCode(zipCode, resultHolder);
|
||||
|
||||
assertTrue(resultHolder.value);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenInvalidZipCode_whenGetSupplierByZipCode_thenFalse() {
|
||||
SupplierService service = new SupplierService();
|
||||
Holder<Boolean> resultHolder = new Holder<>(true);
|
||||
String zipCode = "12345";
|
||||
|
||||
service.getSupplierByZipCode(zipCode, resultHolder);
|
||||
|
||||
assertFalse(resultHolder.value);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue