Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Jun 14, 2024
1 parent a6ab1a4 commit 44e4b02
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public static ArchCondition<JavaField> haveGetterAndSetter(Map<String, String> e

private static ArchCondition<JavaField> buildFieldHaveGetterAndSetterCondition(
boolean forceSetters, Map<String, String> exclusions) {
return new ArchCondition<>(
forceSetters ? HAVE_GETTER_AND_SETTER_DESCRIPTION : HAVE_GETTER_DESCRIPTION) {
return new ArchCondition<>(forceSetters ? HAVE_GETTER_AND_SETTER_DESCRIPTION : HAVE_GETTER_DESCRIPTION) {

@Override
public void check(JavaField field, ConditionEvents events) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ void findByBoroughOrCuisineOrName() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(2);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand Down Expand Up @@ -208,7 +209,8 @@ void termQueryForBorough() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(2);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand All @@ -235,7 +237,8 @@ void termsQueryForBorough() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(2);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand Down Expand Up @@ -264,7 +267,8 @@ void queryBoolWithShould() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(2);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand Down Expand Up @@ -304,7 +308,8 @@ void wildcardSearch() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(1);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(40363920L);
assertThat(restaurant1.getName()).isEqualTo("Yono gardens");
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand All @@ -331,7 +336,8 @@ void regExpSearch() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(2);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand All @@ -358,7 +364,8 @@ void searchSimpleQueryForBoroughAndCuisine() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(2);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand All @@ -383,7 +390,8 @@ void searchRestaurantIdRange() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(1);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand Down Expand Up @@ -411,7 +419,8 @@ void searchDateRange() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(2);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand All @@ -437,7 +446,8 @@ void findAll() {
assertThat(searchPage.isEmpty()).isFalse();
assertThat(searchPage.hasContent()).isTrue();
assertThat(searchPage.stream().count()).isEqualTo(2);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand Down Expand Up @@ -471,7 +481,8 @@ void aggregation() {
.isNotNull()
.isExactlyInstanceOf(ElasticsearchAggregations.class);
assertThat(searchPage.stream().count()).isEqualTo(1);
Restaurant restaurant1 = searchPage.getContent().getFirst().getContent();
Restaurant restaurant1 =
searchPage.getContent().getFirst().getContent();
assertThat(restaurant1.getRestaurantId()).isEqualTo(2L);
assertThat(restaurant1.getName()).isEqualTo(RESTAURANT_NAME);
assertThat(restaurant1.getBorough()).isEqualTo(BOROUGH_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class ContainersConfig {

@DynamicPropertySource
static void setApplicationProperties(DynamicPropertyRegistry dynamicPropertyRegistry) {
dynamicPropertyRegistry.add(
"opensearch.uris", openSearchContainer::getHttpHostAddress);
dynamicPropertyRegistry.add("opensearch.uris", openSearchContainer::getHttpHostAddress);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ RedisCacheConfiguration defaultCacheConfig() {

@Bean
LettuceConnectionFactory redisConnectionFactory(CacheConfigurationProperties properties) {
log.info("Redis (/Lettuce) configuration enabled. With cache timeout {} seconds.", properties.getTimeoutSeconds());
log.info(
"Redis (/Lettuce) configuration enabled. With cache timeout {} seconds.",
properties.getTimeoutSeconds());

RedisStandaloneConfiguration redisStandaloneConfiguration =
new RedisStandaloneConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ public GlobalErrorWebExceptionHandler(
protected RouterFunction<ServerResponse> getRoutingFunction(ErrorAttributes errorAttributes) {
return RouterFunctions.route(RequestPredicates.all(), this::renderErrorResponse);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ public LocalDateTime parseValue(
case StringValue stringValue -> parseString(stringValue.getValue());
case String inputString -> parseString(inputString);
case LocalDateTime localDateTime -> localDateTime;
default -> throw new CoercingParseValueException(
"Expected a 'String' but was '" + typeName(input) + "'.");
default ->
throw new CoercingParseValueException(
"Expected a 'String' but was '"
+ typeName(input)
+ "'.");
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.example.graphql.services.PostDetailsService;
import java.util.List;
import java.util.Optional;

import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down Expand Up @@ -44,9 +43,8 @@ public ResponseEntity<PostDetailsInfo> updatePostDetails(
.findDetailsById(id)
.map(
postDetailsObj ->

postDetailsService.updatePostDetails(
postDetailsObj, postDetailsEntity))
postDetailsService.updatePostDetails(
postDetailsObj, postDetailsEntity))
.map(Optional::get)
.map(ResponseEntity::ok)
.orElseGet(() -> ResponseEntity.notFound().build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.Optional;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@ ProblemDetail onException(MethodArgumentNotValidException methodArgumentNotValid
return problemDetail;
}

record ApiValidationError(
String object, String field, Object rejectedValue, String message) {}
record ApiValidationError(String object, String field, Object rejectedValue, String message) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ PagedResult<Customer> getAllCustomers(
})
})
ResponseEntity<CustomerResponse> getCustomerById(
@Parameter(name = "id", required = true, in = ParameterIn.PATH)
@PathVariable
@Parameter(name = "id", required = true, in = ParameterIn.PATH) @PathVariable
String id);

/**
Expand Down Expand Up @@ -105,6 +104,5 @@ ResponseEntity<CustomerResponse> getCustomerById(
schema = @Schema(implementation = ProblemDetail.class))
})
})
CustomerResponse createCustomer(
@Valid @RequestBody(required = true) Customer customer);
CustomerResponse createCustomer(@Valid @RequestBody(required = true) Customer customer);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ public enum DatabaseType {
DatabaseType(String schemaName) {
this.schemaName = schemaName;
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.example.multitenancy.partition.config.tenant;

import java.util.Map;

import lombok.Setter;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.context.spi.CurrentTenantIdentifierResolver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.example.multitenancy.schema.config.multitenancy;

import java.util.Map;

import lombok.Setter;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.context.spi.CurrentTenantIdentifierResolver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ public enum TenantNameType {
TenantNameType(String tenantName) {
this.tenantName = tenantName;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public Message(boolean valid) {

@Setter
boolean valid;

@Setter
String msg;

Object data;

public void setData(Object data) {
Expand Down

0 comments on commit 44e4b02

Please sign in to comment.