Skip to content

Commit b8300f3

Browse files
authored
fix:fix AppV1ServiceImplTest and blockMapper (#159)
1 parent 48d4e82 commit b8300f3

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

base/src/main/java/com/tinyengine/it/mapper/BlockMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public interface BlockMapper extends BaseMapper<Block> {
137137
@Result(column = "occupier_by", property = "occupier",
138138
one = @One(select = "com.tinyengine.it.mapper.UserMapper.queryUserById"))
139139
})
140-
@Select("select b.*,bcbcb.block_id as block_categories_blocks_id,bsh.block_id as block_histories_block_id "
140+
@Select("select b.*,bh.ref_id as block_id "
141141
+ "from t_block b "
142142
+ "left join t_block_history bh on b.latest_history_id = bh.id "
143143
+ "where b.id = #{blockId} "

base/src/test/java/com/tinyengine/it/service/app/impl/v1/AppV1ServiceImplTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import static org.mockito.Mockito.anyString;
1818
import static org.mockito.Mockito.when;
1919

20+
import com.fasterxml.jackson.core.JsonProcessingException;
21+
import com.fasterxml.jackson.databind.ObjectMapper;
2022
import com.tinyengine.it.mapper.AppExtensionMapper;
2123
import com.tinyengine.it.mapper.AppMapper;
2224
import com.tinyengine.it.mapper.BlockGroupMapper;
@@ -102,12 +104,18 @@ void setUp() {
102104
}
103105

104106
@Test
105-
void testAppSchema() {
107+
void testAppSchema() throws JsonProcessingException {
106108
App app = new App();
107109
int appId = 2;
108110
app.setId(appId);
109111
app.setHomePage(1);
110112
app.setPlatformId(1);
113+
114+
String json = "{\"dataHandler\":{\"type\":\"JSFunction\",\"value\":\"function dataHanlder(res){\\n return res;\\n}\"}}";
115+
ObjectMapper objectMapper = new ObjectMapper();
116+
Map<String, Object> dataSourceGlobal = objectMapper.readValue(json, Map.class);
117+
app.setDataSourceGlobal(dataSourceGlobal);
118+
111119
when(appMapper.queryAppById(anyInt())).thenReturn(app);
112120
Page page = new Page();
113121
page.setIsPage(true);

0 commit comments

Comments
 (0)