-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from aodn/features/6030-text-search-include-param
Features/6030 text search include param
- Loading branch information
Showing
8 changed files
with
843 additions
and
29 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
23 changes: 6 additions & 17 deletions
23
server/src/test/java/au/org/aodn/ogcapi/server/core/service/OGCApiServiceTest.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 |
---|---|---|
@@ -1,44 +1,33 @@ | ||
package au.org.aodn.ogcapi.server.core.service; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class OGCApiServiceTest { | ||
|
||
// The class is abstract, so need to implement it before we can test it. | ||
class OGCApiServiceImpl extends OGCApiService { | ||
@Override | ||
public List<String> getConformanceDeclaration() { | ||
return null; | ||
} | ||
}; | ||
/** | ||
* Verify process function correct, it converts datetime field to CQL filter, here the time isn't important | ||
* as parser will handle it and error out if date time format is incorrect. | ||
*/ | ||
@Test | ||
public void verifyProcessDatetimeParameter() { | ||
OGCApiServiceImpl impl = new OGCApiServiceImpl(); | ||
|
||
String o = impl.processDatetimeParameter("../2021-10-10", ""); | ||
String o = OGCApiService.processDatetimeParameter("../2021-10-10", ""); | ||
assertEquals( "temporal before 2021-10-10", o, "Before incorrect1"); | ||
|
||
o = impl.processDatetimeParameter("/2021-10-10", ""); | ||
o = OGCApiService.processDatetimeParameter("/2021-10-10", ""); | ||
assertEquals( "temporal before 2021-10-10", o, "Before incorrect2"); | ||
|
||
o = impl.processDatetimeParameter("2021-10-10/", ""); | ||
o = OGCApiService.processDatetimeParameter("2021-10-10/", ""); | ||
assertEquals( "temporal after 2021-10-10", o, "After incorrect1"); | ||
|
||
o = impl.processDatetimeParameter("2021-10-10/..", ""); | ||
o = OGCApiService.processDatetimeParameter("2021-10-10/..", ""); | ||
assertEquals( "temporal after 2021-10-10", o, "After incorrect1"); | ||
|
||
o = impl.processDatetimeParameter("2021-10-10/2022-10-10", ""); | ||
o = OGCApiService.processDatetimeParameter("2021-10-10/2022-10-10", ""); | ||
assertEquals( "temporal during 2021-10-10/2022-10-10", o, "During incorrect1"); | ||
|
||
o = impl.processDatetimeParameter("/2021-10-10", "geometry is null"); | ||
o = OGCApiService.processDatetimeParameter("/2021-10-10", "geometry is null"); | ||
assertEquals( "geometry is null AND temporal before 2021-10-10", o, "Before plus filter incorrect1"); | ||
} | ||
} |
Oops, something went wrong.