Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes autoconfiguration to accept standard version of "inProcessServeName" property #368

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

Sarrruman
Copy link
Contributor

The current version does not start the in-process server when setting the property by the name "in-process-server-name," even though it is in accordance with the generated spring-configuration-metadata.json.

The issue lies in ConditionalOnProperty, as it does not support relaxed names, as reported in spring-projects/spring-boot#12282.

The proposed change aims to address this limitation. With the proposed change, all relaxed versions of the property name would work, including "in-process-server-name," "inProcessServerName," "in_process_server_name," and "IN_PROCESS_SERVER_NAME."

@Sarrruman
Copy link
Contributor Author

Can be tested with:

package org.lognet.springboot.grpc;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.lognet.springboot.grpc.demo.DemoApp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = {DemoApp.class}, webEnvironment = NONE, properties = {"grpc.in-process-server-name=dummy"})
public class InProcessAutoconfigurationTest {


  @Autowired
  @Qualifier("grpcInprocessServerRunner")
  GRpcServerRunner grpcServerRunner;

  @Test
  public void shouldConfigureInprocesServer() {
    assertThat(grpcServerRunner).isNotNull();
  }
}

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #368 (ffb2bbe) into master (145e4b8) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #368   +/-   ##
=========================================
  Coverage     87.50%   87.50%           
  Complexity      327      327           
=========================================
  Files            51       51           
  Lines          1608     1608           
  Branches         94       94           
=========================================
  Hits           1407     1407           
  Misses          159      159           
  Partials         42       42           
Files Changed Coverage Δ
...boot/grpc/autoconfigure/GRpcAutoConfiguration.java 84.44% <ø> (ø)

@jvmlet jvmlet merged commit de17cd0 into LogNet:master Jul 26, 2023
4 checks passed
@jvmlet
Copy link
Collaborator

jvmlet commented Jul 26, 2023

Please open the corresponding issue and close it with reference to this commit so it will appear in release notes.

@Sarrruman
Copy link
Contributor Author

closes #369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants