Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @InjectMocks
- private OfferingController offeringController;
- private MockMvc mockMvc;
- @Mock
- private TeamBundleRepository teamBundleRepository;
- @Mock
- private ModelMapper modelMapper;
- public OfferingControllerTest() throws JsonProcessingException {}
- public TeamBundle teamBundle;
- public TeamBundleDTO teamBundleDTO = new TeamBundleDTO(1l, 456l, 567l, "dummy TeamBundle", 1l, 3l , 100d , 20d, 10d, false, false,"INR",new BigDecimal(1.0), null, null, false );
- @Before
- public void setUp() throws Exception {
- mockMvc = MockMvcBuilders.standaloneSetup(offeringController).build();
- teamBundle = new TeamBundle(1l, "dummy TeamBundle", 1l, 3l, 100d, 20d, 10d, 0, 0, "INR", new BigDecimal(1), null, null, null, null, 0);
- }
- @Test
- public void fetch() throws Exception {
- Mockito.when(teamBundleService.findByIdAndIsVenture(1l, false)).thenReturn(teamBundle);
- TeamBundleDTO teamBundleDTO = modelMapper.map(teamBundle, TeamBundleDTO.class);
- mockMvc.perform(get("/1L")
- .contentType(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn();
- }
Add Comment
Please, Sign In to add comment