-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add quarkus test profiles for h2 and PostgresSql
- Loading branch information
1 parent
52f5c2f
commit ca8b1e4
Showing
11 changed files
with
200 additions
and
39 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
30 changes: 30 additions & 0 deletions
30
...-storage-jpa/src/test/java/org/kie/kogito/jobs/service/profiles/H2QuarkusTestProfile.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,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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 | ||
* | ||
* http://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.kie.kogito.jobs.service.profiles; | ||
|
||
import io.quarkus.test.junit.QuarkusTestProfile; | ||
|
||
public class H2QuarkusTestProfile implements QuarkusTestProfile { | ||
|
||
@Override | ||
public String getConfigProfile() { | ||
return "test-h2"; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...-jpa/src/test/java/org/kie/kogito/jobs/service/profiles/PostgreSQLQuarkusTestProfile.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,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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 | ||
* | ||
* http://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.kie.kogito.jobs.service.profiles; | ||
|
||
import io.quarkus.test.junit.QuarkusTestProfile; | ||
|
||
public class PostgreSQLQuarkusTestProfile implements QuarkusTestProfile { | ||
|
||
@Override | ||
public String getConfigProfile() { | ||
return "test-postgresql"; | ||
} | ||
} |
32 changes: 1 addition & 31 deletions
32
...veJobServiceManagementRepositoryTest.java → ...veJobServiceManagementRepositoryTest.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
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
33 changes: 33 additions & 0 deletions
33
...e/kogito/jobs/service/repository/jpa/H2JPAReactiveJobServiceManagementRepositoryTest.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,33 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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 | ||
* | ||
* http://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.kie.kogito.jobs.service.repository.jpa; | ||
|
||
import org.kie.kogito.jobs.service.profiles.H2QuarkusTestProfile; | ||
|
||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.h2.H2DatabaseTestResource; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.quarkus.test.junit.TestProfile; | ||
|
||
@QuarkusTest | ||
@QuarkusTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = true) | ||
@TestProfile(H2QuarkusTestProfile.class) | ||
class H2JPAReactiveJobServiceManagementRepositoryTest extends BaseJPAReactiveJobServiceManagementRepositoryTest { | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
...a/org/kie/kogito/jobs/service/repository/jpa/PostgresSqlJPAReactiveJobRepositoryTest.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,51 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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 | ||
* | ||
* http://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.kie.kogito.jobs.service.repository.jpa; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.kie.kogito.jobs.service.profiles.PostgreSQLQuarkusTestProfile; | ||
import org.kie.kogito.jobs.service.repository.ReactiveJobRepository; | ||
import org.kie.kogito.jobs.service.repository.impl.BaseJobRepositoryTest; | ||
import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; | ||
|
||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.quarkus.test.junit.TestProfile; | ||
|
||
import jakarta.inject.Inject; | ||
|
||
@QuarkusTest | ||
@QuarkusTestResource(value = PostgreSqlQuarkusTestResource.class, restrictToAnnotatedClass = true) | ||
@TestProfile(PostgreSQLQuarkusTestProfile.class) | ||
public class PostgresSqlJPAReactiveJobRepositoryTest extends BaseJobRepositoryTest { | ||
|
||
@Inject | ||
JPAReactiveJobRepository tested; | ||
|
||
@BeforeEach | ||
public void setUp() throws Exception { | ||
|
||
super.setUp(); | ||
} | ||
|
||
@Override | ||
public ReactiveJobRepository tested() { | ||
return tested; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...jobs/service/repository/jpa/PostgresSqlJPAReactiveJobServiceManagementRepositoryTest.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,33 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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 | ||
* | ||
* http://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.kie.kogito.jobs.service.repository.jpa; | ||
|
||
import org.kie.kogito.jobs.service.profiles.PostgreSQLQuarkusTestProfile; | ||
import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; | ||
|
||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.quarkus.test.junit.TestProfile; | ||
|
||
@QuarkusTest | ||
@QuarkusTestResource(value = PostgreSqlQuarkusTestResource.class, restrictToAnnotatedClass = true) | ||
@TestProfile(PostgreSQLQuarkusTestProfile.class) | ||
class PostgresSqlJPAReactiveJobServiceManagementRepositoryTest extends BaseJPAReactiveJobServiceManagementRepositoryTest { | ||
|
||
} |
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