BAEL-5755: remove BAEL-5852 commits

This commit is contained in:
Vladyslav Chernov 2023-11-04 15:38:37 -07:00
parent cea912e42f
commit ee97389e28
3 changed files with 0 additions and 51 deletions

View File

@ -1,9 +0,0 @@
package com.baeldung.holder;
public class Holder<T> {
public T value;
public Holder(T value) {
this.value = value;
}
}

View File

@ -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;
}
}
}

View File

@ -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);
}
}