Commit 6c0102d2 authored by Naren Medarametla's avatar Naren Medarametla

Added Junit test cases

parent 0c701ae8
......@@ -6,8 +6,6 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.web.client.*;
@Configuration
@PropertySource("classpath:application.properties")
public class OfferTransactionConfig {
@Bean
......
......@@ -11,8 +11,11 @@ import org.junit.runner.RunWith;
import org.mockito.*;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
......@@ -20,6 +23,7 @@ import java.util.List;
import java.util.stream.Collectors;
@RunWith(MockitoJUnitRunner.class)
@PropertySource("classpath:application-test.yml")
public class OfferServiceTest {
@Mock
......@@ -47,6 +51,7 @@ public class OfferServiceTest {
@Test
public void serviceTest() {
ReflectionTestUtils.setField(springJunitService, "securityKey", "it's a security key");
OfferTransactionRequest offerTransactionRequest = getOfferTransactionRequest();
Mockito.when(offerLookupRepo.findAll()).thenReturn(returnOffers());
Mockito.when(offerConverter.apply(getOfferTransactionRequest())).thenReturn(getPEReq());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment