Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Apr 17, 2024
1 parent ede2678 commit d3d9ff9
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public class ResourceConfig extends org.glassfish.jersey.server.ResourceConfig {
public ResourceConfig() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
final Class<? extends BinderFactory> binderClass = Class.forName(getBindingFactory())
.asSubclass(BinderFactory.class);

LOG.error(String.format("Binding resources using '%s'", binderClass.getCanonicalName()));

final BinderFactory binderFactory = binderClass.newInstance();
final Binder binder = binderFactory.buildBinder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
web:
build: .
ports:
- "80:8080"
- "8080:8080"
depends_on:
db:
condition: service_healthy
Expand Down
29 changes: 29 additions & 0 deletions athena-examples/athena-example-acceptance-tests/mysql-init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-- Copyright Jiaqi Liu
--
-- 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
--
-- 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.

CREATE DATABASE IF NOT EXISTS Athena;
USE Athena;

CREATE TABLE BOOK_META_DATA (
id int NOT NULL AUTO_INCREMENT,
file_id VARCHAR(255) NOT NULL,
file_name VARCHAR(255) NOT NULL,
file_type VARCHAR(8) NOT NULL,
PRIMARY KEY (id)
);

-- Predefined test data
INSERT INTO BOOK_META_DATA (file_id, file_name, file_type) VALUES ('1', 'Harry Potter', 'PDF');
INSERT INTO BOOK_META_DATA (file_id, file_name, file_type) VALUES ('2', 'Moby Dick', 'PDF');
INSERT INTO BOOK_META_DATA (file_id, file_name, file_type) VALUES ('3', 'Interview with the vampire', 'PDF');
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class InitStepDefinitions {
@BeforeAll
public static void beforeAll() {
new DockerComposeContainer(new File("docker-compose.yml"))
.withExposedService("web", WS_PORT, Wait.forHttp("/v1/data/book").forStatusCode(200))
.withExposedService("web", WS_PORT, Wait.forHttp("/v1/metadata/graphql").forStatusCode(200))
.start();
initRestAssured();
}
Expand Down
4 changes: 2 additions & 2 deletions athena-examples/athena-example-books/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ services:
web:
build: .
ports:
- "80:8080"
- "8080:8080"
depends_on:
db:
condition: service_healthy
db:
image: "mysql:5.7"
ports:
- "3305:3306"
- "3306:3306"
volumes:
- "./mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql"
environment:
Expand Down
7 changes: 7 additions & 0 deletions athena-examples/athena-example-books/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<groupId>io.github.qubitpi.athena</groupId>
<artifactId>athena-core</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.qubitpi.athena</groupId>
Expand Down Expand Up @@ -68,6 +69,12 @@
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
athena__example_config_key="example-value"
athena__data_source_provider=io.github.qubitpi.athena.example.books.application.BooksBinderFactory\
$MySQLDataSourceProvider
athena__data_source_provider=io.github.qubitpi.athena.example.books.application.BooksBinderFactory$MySQLDataSourceProvider
athena__resource_binder=io.github.qubitpi.athena.example.books.application.BooksBinderFactory
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@
</systemPropertyVariables>
<includes>
<include>%regex[.*Spec.*]</include>
<include>**/RunCucumberTest*.java</include>
<!-- <include>**/RunCucumberTest*.java</include>-->
</includes>
<excludes>
<exclude>%regex[.*ITSpec.*]</exclude>
Expand Down

0 comments on commit d3d9ff9

Please sign in to comment.