/*
 * Copyright 2016, Jürgen Dufner
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package de.jdufner.microservice.primes;

import org.junit.Test;

/**
 * @author Jürgen Dufner
 * @since 0.0.1
 */
public class PrimesControllerTest {

  @Test
  public void testPrimes() {
    PrimesController pc = new PrimesController();
    System.out.println(pc.primes(100));
  }

}
@@ -647,19 +647,391 @@
 org.
-junit.Test;
+assertj.core.api.Assertions;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0Aimport org.springframework.beans.factory.ObjectFactory;%0Aimport org.springframework.test.util.ReflectionTestUtils;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A
 %0A%0A/*
@@ -1077,16 +1077,51 @@
 0.1%0A */%0A
+@RunWith(MockitoJUnitRunner.class)%0A
 public c
@@ -1156,129 +1156,766 @@
 %0A  @
-Test%0A  public void testPrimes() %7B%0A    PrimesController pc = new PrimesControll
+InjectMocks%0A  private PrimesController primesController;%0A%0A  @Mock%0A  private ObjectFactory%3CList%3CAbstractPrimesComputer%3E%3E primesComputerObjectFactories;%0A%0A  @Test%0A  public void testPrimes() %7B%0A    // arrange%0A    List%3CAbstractPrimesComputer%3E primesComputers = new ArrayList%3C%3E();%0A    PrimesOnlyPrimesComputer primesOnlyPrimesComputer = new PrimesOnlyPrimesComputer();%0A    primesComputers.add(primesOnlyPrimesComput
 er
-(
 );%0A    
-System.out.println(pc.primes(100)
+Mockito.when(primesComputerObjectFactories.getObject()).thenReturn(primesComputers);%0A    ReflectionTestUtils.setField(primesController, %22strategy%22, primesOnlyPrimesComputer.getClass().getSimpleName());%0A%0A    // act%0A    PrimesResult primesResult = primesController.primes(100);%0A%0A    // assert%0A    Assertions.assertThat(primesResult).isNotNull(
 );%0A 
@@ -1919,8 +1919,9 @@
 ;%0A  %7D%0A%0A%7D
+%0A

Fix Test