34. @PaulienVanAlst#Devoxx #Kotlin
Migrate PoJo’s
@Value
public class BoardGame {
private final String name;
private final Category category;
private final AgeRange ageRange;
private final NumberOfPlayers numberOfPlayers;
private final Rating rating;
}
35. @PaulienVanAlst#Devoxx #Kotlin
Migrate PoJo’s
@Value
public class BoardGame {
private final String name;
private final Category category;
private final AgeRange ageRange;
private final NumberOfPlayers numberOfPlayers;
private final Rating rating;
}
data class BoardGame ( val name: String,
val category: Category,
val ageRange: AgeRange,
val numberOfPlayers: NumberOfPlayers,
val rating: Rating
)
39. @PaulienVanAlst#Devoxx #Kotlin
Rewrite unit tests
@Test
void when_game_is_rated_then_the_game_with_new_average_rate_is_returned()
@Test
fun `when game is rated then the game with new average rate is returned`()
48. @PaulienVanAlst#Devoxx #Kotlin
Configuration
@SpringBootApplication
public class Application {
public static void main (String[] args) {
SpringApplication.run(Application.class, args);
}
}
@SpringBootApplication
open class Application
fun main(args: Array<String>) {
SpringApplication.run(Application::class.java, *args)
}