com.freemanan.starter.grpc.extensions.test.LocalGrpcPort Maven / Gradle / Ivy
package com.freemanan.starter.grpc.extensions.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation at the field that injects the gRPC server port that was allocated at runtime.
*
* Example:
*
*
{@code
* @SpringBootTest
* class FooTest{
* @LocalGrpcPort
* int port;
* }
* }
*
* @author Freeman
* @see org.springframework.boot.test.web.server.LocalServerPort
*/
@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface LocalGrpcPort {}