@Test void shouldAssemble() { PokemonInfo pokemonInfo = fromJson("a valid pokemon info", PokemonInfo.class); Pokemon pokemon = pokemonInfoToPokemonAssembler.assemble(pokemonInfo); assertThat(pokemon, notNullValue()); assertThat(pokemon.getAbilities(), equalTo(Arrays.asList(Ability.LIMBER))); assertThat(pokemon.getBaseExperience(), equalTo(101)); assertThat(pokemon.getHeight(), equalTo(3)); assertThat(pokemon.getId(), equalTo(132)); assertThat(pokemon.getName(), equalTo("ditto")); assertThat(pokemon.getWeight(), equalTo(40)); }
public Pokemon assemble(PokemonInfo data) { return Pokemon.builder() .id(data.getId()) .name(data.getName()) .abilities(assembleAbilities(data)) .baseExperience(data.getBaseExperience()) .weight(data.getWeight()) .height(data.getHeight()) .build(); }
PokemonInfoToPokemonAssembler { public Pokemon assemble(PokemonInfo data) { return Pokemon.builder() .id(data.getId()) .name(data.getName()) .abilities(assembleAbilities(data)) .baseExperience(data.getBaseExperience()) .weight(data.getWeight()) .height(data.getHeight()) .build(); } }
PokemonInfoToPokemonAssembler { public Pokemon assemble(PokemonInfo data) { return Pokemon.builder() .id(data.getId()) .name(data.getName()) .abilities(assembleAbilities(data)) .baseExperience(data.getBaseExperience()) .weight(data.getWeight()) .height(data.getHeight()) .build(); }  }
PokemonInfoToPokemonAssembler { public Pokemon assemble(PokemonInfo data) { return Pokemon.builder() .id(data.getId()) .name(data.getName()) .abilities(assembleAbilities(data)) .baseExperience(data.getBaseExperience()) .weight(data.getWeight()) .height(data.getHeight()) .build(); }  Pokemon assemble(PokemonInfo data); }
PokemonInfoToPokemonAssembler { public Pokemon assemble(PokemonInfo data) { return Pokemon.builder() .id(data.getId()) .name(data.getName()) .abilities(assembleAbilities(data)) .baseExperience(data.getBaseExperience()) .weight(data.getWeight()) .height(data.getHeight()) .build(); }  Pokemon assemble(PokemonInfo data);  }