### Question:
ConsentFactory { public static BaseConsent fromResponse(String responseBody) { if(containsMissingScopesForm(responseBody)) { return new ScopeApprovalConsent(responseBody); } return new PlainConsent(responseBody); }  static BaseConsent fromResponse(String responseBody);  }### Answer:
@Test public void testFromResponse_whenResponseDoesNotRequireUserApproval_shouldReturnPlainConsent() throws IOException { assertThat(ConsentFactory.fromResponse(resourceAsString("__files/login/simple_consent_form.html"))).isInstanceOf(PlainConsent.class); }
@Test public void testFromResponse_whenResponseDoesRequiresUserApproval_shouldReturnScopeApprovalConsent() throws IOException { assertThat(ConsentFactory.fromResponse(resourceAsString("__files/login/user_consent_form.html"))).isInstanceOf(ScopeApprovalConsent.class); }