-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDR-1391 Reject invalid fetch/offset with HTTP 422
- Loading branch information
Showing
8 changed files
with
233 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
aql-engine/src/test/java/org/ehrbase/openehr/test/Fixture.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2019-2024 vitasystems GmbH. | ||
* | ||
* This file is part of project EHRbase | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.ehrbase.openehr.test; | ||
|
||
import java.util.Map; | ||
import org.ehrbase.api.service.SystemService; | ||
import org.ehrbase.openehr.aqlengine.repository.PreparedQuery; | ||
import org.jooq.impl.DSL; | ||
|
||
public class Fixture { | ||
|
||
public static SystemService systemService() { | ||
return () -> "test-system-id"; | ||
} | ||
|
||
public static PreparedQuery preparedQuery(String query) { | ||
return new PreparedQuery(DSL.selectFrom(query).getQuery(), Map.of()); | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
aql-engine/src/test/java/org/ehrbase/openehr/test/TestAqlQueryContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (c) 2019-2024 vitasystems GmbH. | ||
* | ||
* This file is part of project EHRbase | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.ehrbase.openehr.test; | ||
|
||
import java.net.URI; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.function.Consumer; | ||
import org.ehrbase.api.dto.AqlQueryContext; | ||
import org.ehrbase.openehr.sdk.response.dto.MetaData; | ||
|
||
public class TestAqlQueryContext implements AqlQueryContext { | ||
|
||
public String executedAql; | ||
public boolean dryRun; | ||
public boolean showExecutedAql; | ||
public boolean showExecutedSql; | ||
public boolean showQueryPlan; | ||
|
||
public Map<MetaProperty, Object> metaProperties = new HashMap<>(); | ||
|
||
public static TestAqlQueryContext create(Consumer<TestAqlQueryContext> block) { | ||
TestAqlQueryContext queryContext = new TestAqlQueryContext(); | ||
block.accept(queryContext); | ||
return queryContext; | ||
} | ||
|
||
@Override | ||
public MetaData createMetaData(URI location) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean showExecutedAql() { | ||
return showExecutedAql; | ||
} | ||
|
||
@Override | ||
public boolean isDryRun() { | ||
return dryRun; | ||
} | ||
|
||
@Override | ||
public boolean showExecutedSql() { | ||
return showExecutedSql; | ||
} | ||
|
||
@Override | ||
public boolean showQueryPlan() { | ||
return showQueryPlan; | ||
} | ||
|
||
@Override | ||
public void setExecutedAql(String executedAql) { | ||
this.executedAql = executedAql; | ||
} | ||
|
||
@Override | ||
public void setMetaProperty(MetaProperty property, Object value) { | ||
metaProperties.put(property, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters