fixed test "getOfferFromPersistence"
This commit is contained in:
@@ -23,8 +23,6 @@ import de.rwu.easydrop.model.Offer;
|
||||
import de.rwu.easydrop.util.Config;
|
||||
|
||||
|
||||
|
||||
|
||||
class OfferRetrieverTest {
|
||||
|
||||
@Mock
|
||||
@@ -56,10 +54,9 @@ class OfferRetrieverTest {
|
||||
@Test
|
||||
void getOfferFromPersistence(){
|
||||
|
||||
// a mock ProductDTO object to return from the offerDTO mock
|
||||
//Mock ProductDTO object to return from the offerDTO mock
|
||||
ProductDTO productDTO = mock(ProductDTO.class);
|
||||
when(productDTO.isAvailable()).thenReturn(false);
|
||||
|
||||
when(productDTO.isAvailable()).thenReturn(true);
|
||||
|
||||
//Arrange
|
||||
String offerId = "187";
|
||||
@@ -67,6 +64,8 @@ class OfferRetrieverTest {
|
||||
when(persistence.getOfferDTOById(offerId)).thenReturn(offerDTO);
|
||||
when(offerDTO.getOfferId()).thenReturn(offerId);
|
||||
when(offerDTO.getLastUpdate()).thenReturn(lastUpdate);
|
||||
when(offerDTO.getSourceProduct()).thenReturn(productDTO);
|
||||
when(offerDTO.getTargetProduct()).thenReturn(productDTO);
|
||||
|
||||
//Act
|
||||
Offer result = offerRetriever.getOfferFromPersistence(offerId);
|
||||
@@ -80,14 +79,4 @@ class OfferRetrieverTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user