I want to create a Lombok class inside a test class
@RunWith(SpringRunner.class)
@SpringBootTest
public class HostelIntegrationTest {
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(NON_NULL)
@EqualsAndHashCode
class User {
String property1;
Instant property2;
Integer property3;
}
but I get this compilation error:
modifier static not allowed here
@Builder
makes a static
internal class inside. The problem is probably the static internal class inside the non-static internal class.
Try to make User
also static
//other annotations
@Builder
static class User {
String property1;
Instant property2;
Integer property3;
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments