Skip to content

Commit

Permalink
Fjerner endepunkt hent-registrering og alt som går mot veilarbregistr…
Browse files Browse the repository at this point in the history
…ering
  • Loading branch information
JulieHillRoa committed Oct 29, 2024
1 parent 9d5ba80 commit 1eb3301
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 257 deletions.
6 changes: 0 additions & 6 deletions nais-dev-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ spec:
namespace: team-rocket
- application: poao-tilgang
namespace: poao
- application: veilarbregistrering
namespace: paw
- application: aia-backend
namespace: paw
- application: paw-arbeidssoekerregisteret-api-oppslag
Expand Down Expand Up @@ -121,10 +119,6 @@ spec:
value: api://dev-gcp.poao.veilarboppfolging/.default
- name: VEILARBOPPFOLGING_URL
value: http://veilarboppfolging.poao/veilarboppfolging
- name: VEILARBREGISTRERING_SCOPE
value: api://dev-gcp.paw.veilarbregistrering/.default
- name: VEILARBREGISTRERING_URL
value: http://veilarbregistrering.paw
- name: KONTOREGISTER_PERSON_V1_SCOPE
value: api://dev-gcp.okonomi.sokos-kontoregister-person/.default
- name: KONTOREGISTER_PERSON_V1_URL
Expand Down
6 changes: 0 additions & 6 deletions nais-prod-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ spec:
namespace: team-rocket
- application: poao-tilgang
namespace: poao
- application: veilarbregistrering
namespace: paw
- application: aia-backend
namespace: paw
- application: paw-arbeidssoekerregisteret-api-oppslag
Expand Down Expand Up @@ -121,10 +119,6 @@ spec:
value: api://prod-gcp.poao.veilarboppfolging/.default
- name: VEILARBOPPFOLGING_URL
value: http://veilarboppfolging.poao/veilarboppfolging
- name: VEILARBREGISTRERING_SCOPE
value: api://prod-gcp.paw.veilarbregistrering/.default
- name: VEILARBREGISTRERING_URL
value: http://veilarbregistrering.paw
- name: KONTOREGISTER_PERSON_V1_SCOPE
value: api://prod-gcp.okonomi.sokos-kontoregister-person/.default
- name: KONTOREGISTER_PERSON_V1_URL
Expand Down

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/java/no/nav/veilarbperson/config/ClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import no.nav.veilarbperson.client.representasjon.RepresentasjonClientImpl;
import no.nav.veilarbperson.client.veilarboppfolging.VeilarboppfolgingClient;
import no.nav.veilarbperson.client.veilarboppfolging.VeilarboppfolgingClientImpl;
import no.nav.veilarbperson.client.veilarbregistrering.VeilarbregistreringClient;
import no.nav.veilarbperson.client.veilarbregistrering.VeilarbregistreringClientImpl;
import no.nav.veilarbperson.service.AuthService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -115,13 +113,6 @@ public RepresentasjonClient representasjonClient(EnvironmentProperties propertie
() -> authService.getAadOboTokenForTjeneste(properties.getReprApiScope()));
}

@Bean
public VeilarbregistreringClient veilarbregistreringClient(EnvironmentProperties properties, AzureAdMachineToMachineTokenClient aadMachineToMachineTokenClient) {
return new VeilarbregistreringClientImpl(RestClient.baseClient(),
properties.getVeilarbregistreringUrl(),
() -> aadMachineToMachineTokenClient.createMachineToMachineToken(properties.getVeilarbregistreringScope()));
}

@Bean
public OppslagArbeidssoekerregisteretClient oppslagArbeidssoekerregisteretClient(
EnvironmentProperties properties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class EnvironmentProperties {
private String skjermedePersonerPipUrl;
private String veilarboppfolgingScope;
private String veilarboppfolgingUrl;
private String veilarbregistreringScope;
private String veilarbregistreringUrl;
private String kontoregisterScope;
private String kontoregisterUrl;
private String aiaBackendUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import no.nav.veilarbperson.client.nom.SkjermetClient;
import no.nav.veilarbperson.client.pdl.PdlClient;
import no.nav.veilarbperson.client.regoppslag.RegoppslagClient;
import no.nav.veilarbperson.client.veilarbregistrering.VeilarbregistreringClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -27,7 +26,6 @@ public SelfTestChecks selfTestChecks(
SkjermetClient skjermetClient,
Norg2Client norg2Client,
PdlClient pdlClient,
VeilarbregistreringClient veilarbregistreringClient,
RegoppslagClient regoppslagClient
) {
return new SelfTestChecks(List.of(
Expand All @@ -37,7 +35,6 @@ public SelfTestChecks selfTestChecks(
new SelfTestCheck("Norg2", false, norg2Client),
new SelfTestCheck("PDL", true, pdlClient),
new SelfTestCheck("skjermede-personer", true, skjermetClient),
new SelfTestCheck("Veilarbregistrering", false, veilarbregistreringClient),
new SelfTestCheck("Regoppslag", false, regoppslagClient)
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ public ResponseEntity<String> cvOgJobbprofil(@RequestParam(value = "fnr", requir
return cvJobbprofilService.hentCvJobbprofilJson(fnr);
}

@Deprecated
@GetMapping("/registrering")
public ResponseEntity<String> registrering(@RequestParam(value = "fnr") Fnr fnr) {
authService.stoppHvisEksternBruker();
authService.sjekkLesetilgang(fnr);
return registreringService.hentRegistrering(fnr);
}

@Deprecated
@PostMapping("/registrering/endringer")
public ResponseEntity<String> endringIRegistreringdata(@RequestBody PersonRequestBody personRequestBody) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ public ResponseEntity<String> cvOgJobbprofil(@RequestBody PersonRequest personRe
return cvJobbprofilService.hentCvJobbprofilJson(personRequest.getFnr());
}

@PostMapping("/person/hent-registrering")
@Operation(summary = "Henter registreringen til person")
public ResponseEntity<String> registrering(@RequestBody PersonRequest personRequest) {
authService.stoppHvisEksternBruker();
authService.sjekkLesetilgang(personRequest.getFnr());
return registreringService.hentRegistrering(personRequest.getFnr());
}

@PostMapping("/person/registrering/hent-endringer")
@Operation(summary = "Henter endringer på registreringen til person")
public ResponseEntity<String> endringIRegistreringdata(@RequestBody PersonRequest personRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import no.nav.common.types.identer.Fnr;
import no.nav.veilarbperson.client.aiabackend.AiaBackendClient;
import no.nav.veilarbperson.client.aiabackend.EndringIRegistreringsdataRequestDTO;
import no.nav.veilarbperson.client.veilarbregistrering.VeilarbregistreringClient;
import okhttp3.Response;
import okhttp3.ResponseBody;
import org.springframework.http.ResponseEntity;
Expand All @@ -15,26 +14,8 @@
@Service
public class RegistreringService {

private final VeilarbregistreringClient client;
private final AiaBackendClient aiaBackendClient;

@SneakyThrows
public ResponseEntity<String> hentRegistrering(Fnr fnr) {
try (Response response = client.hentRegistrering(fnr);
ResponseBody responseBody = response.body()) {

String bodyString = null;

if (responseBody != null) {
bodyString = responseBody.string();
}

return ResponseEntity
.status(response.code())
.body(bodyString);
}
}

@SneakyThrows
public ResponseEntity<String> hentEndringIRegistreringsdata(Fnr fnr) {
try (Response response = aiaBackendClient.hentEndringIRegistreringsdata(new EndringIRegistreringsdataRequestDTO(fnr.get()));
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ app.env.skjermedePersonerPipScope=${SKJERMEDE_PERSONER_PIP_SCOPE}
app.env.skjermedePersonerPipUrl=${SKJERMEDE_PERSONER_PIP_URL}
app.env.veilarboppfolgingScope=${VEILARBOPPFOLGING_SCOPE}
app.env.veilarboppfolgingUrl=${VEILARBOPPFOLGING_URL}
app.env.veilarbregistreringScope=${VEILARBREGISTRERING_SCOPE}
app.env.veilarbregistreringUrl=${VEILARBREGISTRERING_URL}
app.env.kontoregisterScope=${KONTOREGISTER_PERSON_V1_SCOPE}
app.env.kontoregisterUrl=${KONTOREGISTER_PERSON_V1_URL}
app.env.aiaBackendUrl=${AIA_BACKEND_URL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@
import no.nav.veilarbperson.client.pdl.PdlClient;
import no.nav.veilarbperson.client.pdl.domain.PdlRequest;
import no.nav.veilarbperson.client.representasjon.RepresentasjonClient;
import no.nav.veilarbperson.client.representasjon.RepresentasjonClientImpl;
import no.nav.veilarbperson.client.veilarboppfolging.UnderOppfolging;
import no.nav.veilarbperson.client.veilarboppfolging.VeilarboppfolgingClient;
import no.nav.veilarbperson.client.veilarbregistrering.VeilarbregistreringClient;
import no.nav.veilarbperson.client.veilarbregistrering.VeilarbregistreringClientImpl;
import okhttp3.Response;
import org.jetbrains.annotations.NotNull;
import org.mockito.Mockito;
Expand Down Expand Up @@ -279,12 +276,6 @@ public SelfTestChecks selfTestChecks() {
return mock(SelfTestChecks.class);
}

@Bean
public VeilarbregistreringClient veilarbregistreringClient() {
return new VeilarbregistreringClientImpl(
RestClient.baseClient(), "http://localhost:" + WIREMOCK_PORT, () -> "");
}

@Bean
public OppslagArbeidssoekerregisteretClient oppslagArbeidssoekerregisteretClient() {
return new OppslagArbeidssoekerregisteretClientImpl(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,55 +47,6 @@ public class PersonV3ControllerTest {
@MockBean
private PersonV2Service personV2Service;

@Test
public void returnerer_registrering_for_registrert_bruker() throws Exception {
PrivatBruker ny = navContext.getPrivatBrukere().ny();
NavAnsatt navAnsatt = navContext.getNavAnsatt().nyFor(ny);

String expectedJson = "{}";
String fnr = ny.getNorskIdent();

stubFor(WireMock.get(urlEqualTo("/veilarbregistrering/api/registrering?fnr=" + fnr))
.willReturn(ok()
.withHeader("Content-Type", "application/json")
.withBody(expectedJson)));


mockMvc
.perform(
post("/api/v3/person/hent-registrering")
.contentType(APPLICATION_JSON)
.content("{\"fnr\":\"" + fnr + "\"}")
.header("test_ident", navAnsatt.getNavIdent())
.header("test_ident_type", "INTERN")
)
.andExpect(content().json(expectedJson))
.andExpect(status().is(200));
}

@Test
public void returnerer_ikke_registrering_for_bruker_som_ikke_er_registrert() throws Exception {
PrivatBruker ny = navContext.getPrivatBrukere().ny();
NavAnsatt navAnsatt = navContext.getNavAnsatt().nyFor(ny);
String fnr = ny.getNorskIdent();

stubFor(WireMock.get(urlEqualTo("/veilarbregistrering/api/registrering?fnr=" + fnr))
.willReturn(
notFound()
.withHeader("Content-Type", "application/json")));


mockMvc
.perform(
post("/api/v3/person/hent-registrering")
.contentType(APPLICATION_JSON)
.content("{\"fnr\":\"" + fnr + "\"}")
.header("test_ident", navAnsatt.getNavIdent())
.header("test_ident_type", "INTERN")
)
.andExpect(status().is(404));
}

@Test
public void returnerer_person_uten_behandlingsnummer_hent_person() throws Exception {
PrivatBruker ny = navContext.getPrivatBrukere().ny();
Expand Down

0 comments on commit 1eb3301

Please sign in to comment.