Skip to content

Commit

Permalink
DCB-84 Fix maintainer code when getting details
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-andrzejak committed Sep 5, 2023
1 parent 4ce57f3 commit 0127559
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE-THIRD-PARTY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Lists of 149 third-party dependencies.
(The Apache Software License, Version 2.0) Java Faker (com.github.javafaker:javafaker:1.0.2 - http://github.com/DiUS/java-faker)
(The Apache Software License, Version 2.0) Generex (com.github.mifmif:generex:1.0.2 - https://github.com/mifmif/Generex/tree/master)
(The Apache Software License, Version 2.0) project ':json-path' (com.jayway.jsonpath:json-path:2.6.0 - https://github.com/jayway/JsonPath)
(Apache License, Version 2.0) appstore-metadata-service (com.lgi.appstore.metadata:appstore-metadata-service:0.1.11-SNAPSHOT - https://spring.io/projects/spring-boot/appstore-metadata-service-parent/appstore-metadata-service)
(Apache License, Version 2.0) appstore-metadata-service (com.lgi.appstore.metadata:appstore-metadata-service:0.1.12-SNAPSHOT - https://spring.io/projects/spring-boot/appstore-metadata-service-parent/appstore-metadata-service)
(Eclipse Distribution License - v 1.0) Old JAXB Runtime (com.sun.xml.bind:jaxb-impl:2.3.3 - https://eclipse-ee4j.github.io/jaxb-ri/jaxb-bundles/jaxb-impl)
(Apache License 2.0) JSON library from Android SDK (com.vaadin.external.google:android-json:0.0.20131108.vaadin1 - http://developer.android.com/sdk)
(The Apache Software License, Version 2.0) HikariCP (com.zaxxer:HikariCP:4.0.3 - https://github.com/brettwooldridge/HikariCP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ class MaintainerApiFTSpec extends AsmsFeatureSpecBase {
field().header().icon().from(theBody1) == v1Icon
and: "the body exposes maintainer section with his details"
field().maintainer().code().from(theBody1) == DEFAULT_DEV_CODE
field().maintainer().name().from(theBody1) == DEFAULT_DEV_NAME
field().maintainer().address().from(theBody1) == DEFAULT_DEV_ADDRESS
field().maintainer().homepage().from(theBody1) == DEFAULT_DEV_HOMEPAGE
Expand Down Expand Up @@ -393,6 +394,7 @@ class MaintainerApiFTSpec extends AsmsFeatureSpecBase {
field().header().icon().from(theBody2) == v2Icon
and: "the body exposes maintainer section with his details"
field().maintainer().code().from(theBody2) == DEFAULT_DEV_CODE
field().maintainer().name().from(theBody2) == DEFAULT_DEV_NAME
field().maintainer().address().from(theBody2) == DEFAULT_DEV_ADDRESS
field().maintainer().homepage().from(theBody2) == DEFAULT_DEV_HOMEPAGE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public Optional<MaintainerApplicationDetails> getApplicationDetails(String maint
).collect(Collectors.toList());

return dslContext.select(
MAINTAINER.CODE,
MAINTAINER.NAME,
MAINTAINER.ADDRESS,
MAINTAINER.HOMEPAGE,
Expand Down Expand Up @@ -269,6 +270,7 @@ public Optional<MaintainerApplicationDetails> getApplicationDetails(String maint
).collect(Collectors.toList());

var result = dslContext.select(
MAINTAINER.CODE,
MAINTAINER.NAME,
MAINTAINER.ADDRESS,
MAINTAINER.HOMEPAGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static MaintainerApplicationDetails map(Record applicationMetadataRecord,
return new MaintainerApplicationDetails()
.header(applicationHeader)
.maintainer(new com.lgi.appstore.metadata.model.Maintainer()
.code(applicationMetadataRecord.get(MAINTAINER.CODE))
.name(applicationMetadataRecord.get(MAINTAINER.NAME))
.address(applicationMetadataRecord.get(MAINTAINER.ADDRESS))
.homepage(applicationMetadataRecord.get(MAINTAINER.HOMEPAGE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.jooq.Record10;
import org.jooq.Record13;
import org.jooq.Record20;
import org.jooq.Record21;
import org.jooq.Record22;
import org.jooq.Result;

import java.util.List;
Expand Down Expand Up @@ -66,8 +66,8 @@ private ApplicationPreferredHelper() {
return result.stream().findAny();
}

public static Optional<Record21<String, String, String, String, String, String, Boolean, Boolean, Boolean, String, String, String, String, String, Integer, String, JSONB, JSONB, JSONB, JSONB, JSONB>>
matchByPreferredVersionForDetailsMaintainer(Result<Record21<String, String, String, String, String, String, Boolean, Boolean, Boolean, String, String, String, String, String, Integer, String, JSONB, JSONB, JSONB, JSONB, JSONB>> result) {
public static Optional<Record22<String, String, String, String, String, String, String, Boolean, Boolean, Boolean, String, String, String, String, String, Integer, String, JSONB, JSONB, JSONB, JSONB, JSONB>>
matchByPreferredVersionForDetailsMaintainer(Result<Record22<String, String, String, String, String, String, String, Boolean, Boolean, Boolean, String, String, String, String, String, Integer, String, JSONB, JSONB, JSONB, JSONB, JSONB>> result) {
if (result.size() > 1) {
return result.stream()
.filter(record -> record.get(APPLICATION.PREFERRED).equals(true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ private void verifyMaintainerApplicationDetails(Optional<MaintainerApplicationDe
}
final Maintainer maintainer = maintainerApplicationDetails.getMaintainer();
assertThat(maintainer).isNotNull();
assertThat(maintainer.getCode()).isEqualTo(maintainerRecord.getCode());
assertThat(maintainer.getAddress()).isEqualTo(maintainerRecord.getAddress());
assertThat(maintainer.getEmail()).isEqualTo(maintainerRecord.getEmail());
assertThat(maintainer.getHomepage()).isEqualTo(maintainerRecord.getHomepage());
Expand All @@ -455,6 +456,7 @@ private void verifyMaintainerApplicationDetails(Optional<MaintainerApplicationDe
verifyMaintainerHeader(header, application.getHeader());
final Maintainer maintainer = maintainerApplicationDetails.getMaintainer();
assertThat(maintainer).isNotNull();
assertThat(maintainer.getCode()).isEqualTo(maintainerRecord.getCode());
assertThat(maintainer.getAddress()).isEqualTo(maintainerRecord.getAddress());
assertThat(maintainer.getEmail()).isEqualTo(maintainerRecord.getEmail());
assertThat(maintainer.getHomepage()).isEqualTo(maintainerRecord.getHomepage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ private void verifyStbApplicationDetails(Optional<StbApplicationDetails> maybeSt
verifyStbSingleApplicationHeader(header, applicationRecord, localization);
final Maintainer maintainer = stbApplicationDetails.getMaintainer();
assertThat(maintainer).isNotNull();
assertThat(maintainer.getCode()).isEqualTo(maintainerRecord.getCode());
assertThat(maintainer.getAddress()).isEqualTo(maintainerRecord.getAddress());
assertThat(maintainer.getEmail()).isEqualTo(maintainerRecord.getEmail());
assertThat(maintainer.getHomepage()).isEqualTo(maintainerRecord.getHomepage());
Expand Down
19 changes: 19 additions & 0 deletions charts/index.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2023 Liberty Global Technology Services BV
#
# 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.
#

apiVersion: v1
entries:
appstore-metadata-service:
Expand Down

0 comments on commit 0127559

Please sign in to comment.