Skip to content

Commit

Permalink
use imposter ports _with_ default
Browse files Browse the repository at this point in the history
  • Loading branch information
schulzp committed Jun 24, 2020
1 parent 09e392b commit 26ba561
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* #L%
*/

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import org.slf4j.Logger;
Expand Down Expand Up @@ -48,12 +49,12 @@ public MountebankContainer(Consumer<OutputFrame> logConsumer, Integer... imposte
super("andyrbell/mountebank");
this.imposterPorts = imposterPorts.length == 0 ? List.of(DEFAULT_PROXY_PORT) : List.of(imposterPorts);

final Integer[] allPorts = new Integer[imposterPorts.length + 1];
System.arraycopy(imposterPorts, 0, allPorts, 1, imposterPorts.length);
allPorts[0] = MOUNTEBANK_API_PORT;
final List<Integer> arrayList = new ArrayList<>(this.imposterPorts.size() + 1);
arrayList.add(MOUNTEBANK_API_PORT);
arrayList.addAll(this.imposterPorts);

withReuse(true);
withExposedPorts(allPorts);
withExposedPorts(arrayList.toArray(Integer[]::new));
withCommand("mb", "--debug");
withLogConsumer(logConsumer);
waitingFor(Wait.forLogMessage(".*now taking orders.*", 1));
Expand Down

0 comments on commit 26ba561

Please sign in to comment.