Skip to content

Commit

Permalink
CHanging data model. Increasing version of openapi code generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwendland committed Sep 12, 2023
1 parent b038d96 commit 31407dc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
16 changes: 8 additions & 8 deletions api/credentials-config-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ components:
type: object
description: A specific scope for that service, specifying the necessary VC types (credentials)
additionalProperties:
#type: object
$ref: '#/components/schemas/ServiceScopesEntry'
ServiceScopesEntry:
type: array
minItems: 1
items:
$ref: '#/components/schemas/Credential'
Service:
Expand All @@ -224,16 +224,16 @@ components:
type: string
description: Id of the service to be configured. If no id is provided, the service will generate one.
example: packet-delivery-service
credentials:
type: array
description: All credential configurations for the service
items:
$ref: '#/components/schemas/Credential'
defaultScope:
type: string
description: Default scope to be used if none is specified
example: default
scopes:
$ref: '#/components/schemas/ServiceScopes'
default: null
#required:
# - credentials
required:
- scopes
- default_scope
Services:
type: object
description: The paginated list of services
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

<!-- code gen -->
<version.org.openapitools.generator-maven-plugin>6.6.0</version.org.openapitools.generator-maven-plugin>
<version.io.kokuwa.micronaut.codegen>3.3.1</version.io.kokuwa.micronaut.codegen>
<version.io.kokuwa.micronaut.codegen>3.4.4</version.io.kokuwa.micronaut.codegen>

<!-- test -->
<version.org.mockito.mocktio-all>1.10.19</version.org.mockito.mocktio-all>
Expand Down Expand Up @@ -245,7 +245,7 @@
<apiPackage>org.fiware.iam.ccs.api</apiPackage>
<strictSpec>true</strictSpec>
<modelPackage>org.fiware.iam.ccs.model</modelPackage>
<generateAliasAsModel>false</generateAliasAsModel>
<generateAliasAsModel>true</generateAliasAsModel>
<generateApiTests>true</generateApiTests>
<generatorName>micronaut</generatorName>
<modelNameSuffix>VO</modelNameSuffix>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/fiware/iam/repository/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class Service {
@Id
private String id;

private String defaultScope;

@OneToMany(mappedBy = "service", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
private Collection<Credential> credentials;
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ public void getScopeForService404() throws Exception {
public void getService200() throws Exception {

HttpResponse<ServiceVO> theServiceResponse = testClient.getService(theService.getId());
assertEquals(HttpStatus.OK, theServiceResponse.getStatus(), "The service should be responded.");
assertEquals(theService, theServiceResponse.body(), "The service should be responded.");
assertEquals(HttpStatus.OK, theServiceResponse.getStatus(), "The service should be responded with status OK.");
assertEquals(theService, theServiceResponse.body(), "The service should be responded with equal service object.");
}

@ParameterizedTest
Expand Down Expand Up @@ -298,8 +298,8 @@ private static Stream<Arguments> invalidPagination() {
@Override
public void updateService200() throws Exception {
HttpResponse<ServiceVO> updatedService = testClient.updateService(theService.getId(), theService);
assertEquals(HttpStatus.OK, updatedService.status(), "The service should have been updated.");
assertEquals(theService, updatedService.body(), "The service should have been updated.");
assertEquals(HttpStatus.OK, updatedService.status(), "The service should have been updated withst status OK.");
assertEquals(theService, updatedService.body(), "The service should have been updated with an equal object.");
}

@ParameterizedTest
Expand Down

0 comments on commit 31407dc

Please sign in to comment.