fix small issues

This commit is contained in:
f43nd1r 2018-08-24 06:27:16 +02:00
parent 45fb0eb029
commit 8baec661a6
3 changed files with 6 additions and 3 deletions

View file

@ -103,7 +103,7 @@ public class RestReportInterface {
name += "_" + mail;
}
if (id != null && !id.isEmpty()) {
where = where.and(report.installationId.eq(id));
where = report.installationId.eq(id).and(where);
name += "_" + id;
}
if (name.isEmpty()) {

View file

@ -620,6 +620,9 @@ databaseChangeLog:
id: 2018-08-24-fix-permission-key
author: lukas
changes:
- addNotNullConstraint:
columnName: app_id
tableName: user_permissions
- addPrimaryKey:
columnNames: user_username, app_id
tableName: user_permissions

View file

@ -69,10 +69,10 @@ public class RestReportInterfaceTest {
@Autowired MockMvc mvc;
@Before
public void setUp() throws Exception {
public void setUp() {
App app = mock(App.class);
when(dataService.findApp(TEST_STRING)).thenReturn(Optional.of(app));
when(dataService.getFromReports(any(), any(), any())).thenReturn(Arrays.asList("{\"name\":\"a\"}", "{\"name\":\"b\"}"));
when(dataService.getFromReports(any(), any(), any(), any())).thenReturn(Arrays.asList("{\"name\":\"a\"}", "{\"name\":\"b\"}"));
}
@Test