diff --git a/src/main/java/com/faendir/acra/rest/RestReportInterface.java b/src/main/java/com/faendir/acra/rest/RestReportInterface.java index 3e37500..ab6e417 100644 --- a/src/main/java/com/faendir/acra/rest/RestReportInterface.java +++ b/src/main/java/com/faendir/acra/rest/RestReportInterface.java @@ -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()) { diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index 2e1a640..fea9b37 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -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 diff --git a/src/test/java/com/faendir/acra/rest/RestReportInterfaceTest.java b/src/test/java/com/faendir/acra/rest/RestReportInterfaceTest.java index 053cf3c..35d364c 100644 --- a/src/test/java/com/faendir/acra/rest/RestReportInterfaceTest.java +++ b/src/test/java/com/faendir/acra/rest/RestReportInterfaceTest.java @@ -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