|
@@ -86,11 +86,14 @@ public class ThemeLogicImplTest {
|
|
CourseResource courseResource = new CourseResource();
|
|
CourseResource courseResource = new CourseResource();
|
|
CourseResourceVO courseResourceVO = new CourseResourceVO();
|
|
CourseResourceVO courseResourceVO = new CourseResourceVO();
|
|
ThemeEntityRelations themeEntityRelations = new ThemeEntityRelations();
|
|
ThemeEntityRelations themeEntityRelations = new ThemeEntityRelations();
|
|
- when(courseResourceService.getCourseResourceByResourceId(1L)).thenReturn(courseResource);
|
|
|
|
|
|
+ ThemeDetail course = new ThemeDetail();
|
|
|
|
+ course.setIsDeleted(0);
|
|
|
|
+ course.setReleased(0);
|
|
|
|
+ when(themeService.getThemeDetailById(1L)).thenReturn(course);
|
|
when(courseResourceVOWrapper.wrap(courseResource)).thenReturn(courseResourceVO);
|
|
when(courseResourceVOWrapper.wrap(courseResource)).thenReturn(courseResourceVO);
|
|
when(themeService.checkRelationBetweenThemeAndEntity(1L, 1L, EntityTypeEnum.COURSE_RESOURCE)).thenReturn(themeEntityRelations);
|
|
when(themeService.checkRelationBetweenThemeAndEntity(1L, 1L, EntityTypeEnum.COURSE_RESOURCE)).thenReturn(themeEntityRelations);
|
|
thrown.expect(HttpForbiddenException.class);
|
|
thrown.expect(HttpForbiddenException.class);
|
|
- thrown.expectMessage("This Course should buy and resource can't preview");
|
|
|
|
|
|
+ thrown.expectMessage("This Course should buy or hasn't open, and resource can't preview");
|
|
themeLogic.getCourseResource(1L,1L);
|
|
themeLogic.getCourseResource(1L,1L);
|
|
}
|
|
}
|
|
}
|
|
}
|